edendevelopment / cfi

Childrens' Future International
http://www.childrensfutureinternational.org/
MIT License
24 stars 7 forks source link

User attaches picture to household #21

Open chrismdp opened 13 years ago

chrismdp commented 13 years ago

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.

vtatai commented 13 years ago

Can i grab this one?

chrismdp commented 13 years ago

Sure thing! Would you mind writing out a cucumber feature and posting it so I can check it with CFI?

vtatai commented 13 years ago

Is something like this ok?

Feature: User attaches 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 press "Edit"
    And I add the photo "sample.jpg"
    And I press "Update"
    Then I should be on the page for household "Hun"
    And 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"
    And I should not see a picture for the household
chrismdp commented 13 years ago

Looks good to me. I'd avoid using web_steps though: instead of:

When I go to the page for household "Hun"
And I press "Edit"
And I add the photo "sample.jpg"
And I press "Update"

I'd do:

When I upload a photo for household "Hun"