Skip to content

Commit

Permalink
Updating for Rails 3 and Rspec 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahmei committed Oct 4, 2010
1 parent d0a6ec6 commit 1fbd227
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 212 deletions.
10 changes: 5 additions & 5 deletions topics.feature → 1_topics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ Feature: Topics
people need to be able to create and edit them

Scenario: Getting to the new topic page
When I go to topics
And I follow "New topic"
When I go to the topics page
And I follow "New Topic"
Then I should see a "Create" button

Scenario: Creating a topic
Given I go to topics
And I follow "New topic"
Given I go to the topics page
And I follow "New Topic"
When I fill in "Title" with "Rails Fixtures"
And I fill in "Description" with "Introduce how to add test data with fixtures."
And I press "Create"
Then I should see "Rails Fixtures"
And I should be on topics
And I should be on the topics page


Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ Feature: Topics List and Details
and see details about them

Background: Make sure we have a topic in the list
Given I go to topics
And I follow "New topic"
Given I go to the topics page
And I follow "New Topic"
When I fill in "Title" with "Rails Fixtures"
And I fill in "Description" with "Introduce how to add test data with fixtures."
And I press "Create"

Scenario: Clicking on the topic title
When I follow "Rails Fixtures"
Scenario: Viewing a topic detail page
When I go to the topics page
And I follow "Rails Fixtures"
Then I should see "Introduce how to add test data with fixtures."
And I should not see "add a topic"
And I should not see "New Topic"

Scenario: Deleting a topic
When I go to the topics page
When I follow "Delete"
Then I should not see "Rails Fixtures"
And I should see "New topic"
And I should see "New Topic"

11 changes: 6 additions & 5 deletions votes.feature → 3_votes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ Feature: Votes
people need to be able to vote for the ones they like

Background: Make sure that we have a topic
Given I go to topics
And I follow "New topic"
When I fill in "Title" with "Rails Fixtures"
Given I go to the topics page
And I follow "New Topic"
And I fill in "Title" with "Rails Fixtures"
And I fill in "Description" with "Introduce how to add test data with fixtures."
And I press "Create"

Scenario: viewing votes already cast
When I go to topics
When I go to the topics page
Then I should see "0 votes"

Scenario: voting on a topic
When I follow "+1"
When I go to the topics page
And I follow "+1"
Then I should see "1 vote"
4 changes: 2 additions & 2 deletions authenticated_votes.feature → 4_authenticated_votes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Feature: Votes with authentication
and since we know who they are, they can take back their vote!

Background: Make sure that we have a topic
Given I go to topics
And I follow "New topic"
Given I go to the topics page
And I follow "New Topic"
When I fill in "Title" with "Rails Fixtures"
And I fill in "Description" with "Introduce how to add test data with fixtures."
And I press "Create"
Expand Down
10 changes: 0 additions & 10 deletions step_definitions/new_webrat_steps.rb

This file was deleted.

3 changes: 3 additions & 0 deletions step_definitions/topic_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Then /^I should see a "([^\"]*)" button$/ do |button_name|
find_button(button_name)
end
Loading

0 comments on commit 1fbd227

Please sign in to comment.