Skip to content

Commit

Permalink
Cleaning up features so they dont contain too many implementation spe…
Browse files Browse the repository at this point in the history
…cific steps
  • Loading branch information
Victor Tatai committed Mar 24, 2011
1 parent 035b253 commit 10018fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
@@ -1,24 +1,18 @@
Feature: User attaches picture to household
Feature: User adds picture to household
In order to show pictures for households,
As any user
I want to be able to upload a picture of the entire household to the household page

Scenario: User attaches picture to household
Given I am a new, authenticated user
And a household called "Hun"
When I go to the page for household "Hun"
And I follow "Edit"
And I add the photo "sample.jpg" to the household
And I press "Update"
Then I should be on the page for household "Hun"
And I should see a picture for the household
When I upload a picture for household "Hun"
Then I should see a picture for the household

Scenario: User removes picture from household
Given I am a new, authenticated user
And a household called "Hun"
And a picture "sample.jpg" for household "Hun"
When I go to the page for household "Hun"
And I press "Remove picture"
Then I should be on the page for household "Hun"
When I remove the picture for household "Hun"
And I should not see a picture for the household

14 changes: 12 additions & 2 deletions features/step_definitions/household_steps.rb
Expand Up @@ -59,7 +59,7 @@
end
end

When /^I add the photo "([^\"]*)" to the household$/ do |file_name|
When /^I add the picture "([^\"]*)" to the household$/ do |file_name|
attach_file "household_image", Rails.root.join('test', 'fixtures', file_name)
end

Expand All @@ -74,8 +74,18 @@
Given /^a picture "([^"]*)" for household "([^"]*)"$/ do |file_name, household_name|
When "I go to the page for household \"#{household_name}\""
And "I follow \"Edit\""
And "I add the photo \"#{file_name}\" to the household"
And "I add the picture \"#{file_name}\" to the household"
And "I press \"Update\""
Then "I should be on the page for household \"#{household_name}\""
And "I should see a picture for the household"
end

When /^I upload a picture for household "([^"]*)"$/ do |household_name|
Given "a picture \"sample.jpg\" for household \"#{household_name}\""
end

When /^I remove the picture for household "([^"]*)"/ do |household_name|
When "I go to the page for household \"#{household_name}\""
And "I press \"Remove picture\""
Then "I should be on the page for household \"#{household_name}\""
end

0 comments on commit 10018fa

Please sign in to comment.