-
Notifications
You must be signed in to change notification settings - Fork 20
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
Typo Blog: Fixing admin categories bug #9
base: master
Are you sure you want to change the base?
Changes from 9 commits
92e3069
ad074c3
d10b0aa
c86baf4
73056b2
ae5c9d5
a7a9537
c57479e
2481cb7
fbcf076
634e1c4
b06de3f
1808207
c71a75d
e091fe4
55e8b9f
4472780
36d799a
e02ae03
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Feature: Manage Categories | ||
As a blog administrator | ||
In order to organize my posts | ||
I want to be able to add and edit categories | ||
|
||
Background: | ||
Given the blog is set up | ||
And I am logged into the admin panel | ||
|
||
Scenario: Successfully add a category | ||
Given there are no categories | ||
When I follow "Categories" | ||
And I fill in "Name" with "Test" | ||
And I press "Save" | ||
Then I should see "Category was successfully saved." | ||
And I should see "Test" | ||
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. Nice! |
||
|
||
Scenario: Successfully edit a 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. These are two good scenarios. Should you add any for editing or error cases? |
||
Given I have 1 category | ||
When I follow "Categories" | ||
When I follow "Edit" | ||
And I fill in "Name" with "Another Test" | ||
And I press "Save" | ||
Then I should see "Category was successfully saved." | ||
And I should see "Another Test" | ||
And I should have 1 category |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,17 @@ | |
assert_response :redirect, :action => 'index' | ||
end | ||
|
||
describe "test_new" do | ||
before(:each) do | ||
get :new | ||
end | ||
|
||
it "should render the new template" do | ||
get "new" | ||
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. Is this necessary since it is in the before each? |
||
expect(subject).to render_template :new | ||
end | ||
end | ||
|
||
describe "test_edit" do | ||
before(:each) do | ||
get :edit, :id => Factory(:category).id | ||
|
@@ -48,7 +59,7 @@ | |
|
||
it 'should render destroy template' do | ||
assert_response :success | ||
assert_template 'destroy' | ||
assert_template 'destroy' | ||
end | ||
end | ||
|
||
|
@@ -62,5 +73,5 @@ | |
|
||
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.
eek! no check-ins with pry!