-
Notifications
You must be signed in to change notification settings - Fork 19
Create and Edit Category Bug Fix #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
426ded5
0f82c45
4ea7427
9758489
aeea9ca
498fcc2
a0cac85
e60682e
1b81836
6638ff4
86af143
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ config/mail.yml | |
| *~ | ||
| db/*.sqlite* | ||
| db/schema.rb | ||
| db/db_development | ||
| db/db_test | ||
| .*.swp | ||
| .*.swo | ||
| .DS_Store | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| class CategoriesController < GroupingController | ||
| # index - inherited | ||
| # show - inherited | ||
| def new | ||
| render 'new' | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| Feature: Create category | ||
| As an admin | ||
| In order to categorize my blogs | ||
| I want create and manage blog categories | ||
|
|
||
| Background: | ||
| Given the blog is set up | ||
| And I am logged into the admin panel | ||
|
|
||
| Scenario: Create category | ||
| Given I am a user | ||
| When I am on the homepage | ||
| Then I should be able to click "Categories" | ||
| And I should be able add a new category | ||
|
|
||
| Scenario: Successfully visit categories page | ||
| Given there are no categories | ||
| When I follow "Categories" | ||
| When I fill in "Name" with "dogs" | ||
| Then I should be able to click "Categories" | ||
| And I should have 1 category | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might also be good to add a "I should see 'dogs'"
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, thanks! |
||
| And I should see "dogs" | ||
|
|
||
| Scenario: Create a Category | ||
| When I follow "Categories" | ||
| And I fill in "Name" with "dogs" | ||
| And I fill in "Keywords" with "dogs" | ||
| And I fill in "Permalink" with "www.test.com" | ||
| And I fill in "Description" with "fun" | ||
| And I press "Save" | ||
| Then I should see "Category was successfully saved." | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment re: seeing the newly created category
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, thanks! |
||
| And I should see "dogs" | ||
|
|
||
| Scenario: Edit a Category | ||
| When I go to the edit page for "dogs" | ||
| And I fill in "Description" with "playful" | ||
| And I press "Save" | ||
| Then I should see "Category was successfully saved." | ||
| And I should see "dogs" | ||
|
|
||
| Scenario: Cancel editing | ||
| When I got to the edit page for "dogs" | ||
| And I press "Cancel" | ||
| Then I should go to "Categories" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,16 @@ | |
| request.session = { :user => henri.id } | ||
| end | ||
|
|
||
| it "renders the 'new' template" do | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these tests are good! |
||
| get :new | ||
| expect(response).to render_template :new | ||
| end | ||
|
|
||
| it "successfully loads 'new' page" do | ||
| get :new | ||
| expect(response.status).to eq 200 | ||
| end | ||
|
|
||
| it "test_index" do | ||
| get :index | ||
| assert_response :redirect, :action => 'index' | ||
|
|
@@ -48,7 +58,7 @@ | |
|
|
||
| it 'should render destroy template' do | ||
| assert_response :success | ||
| assert_template 'destroy' | ||
| assert_template 'destroy' | ||
| end | ||
| end | ||
|
|
||
|
|
@@ -62,5 +72,4 @@ | |
|
|
||
| assert_raise(ActiveRecord::RecordNotFound) { Category.find(test_id) } | ||
| end | ||
|
|
||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this since the bulk of the work is in the admin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked my git status and didn't commit this deletion. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still in here - maybe missing another commit?