Commit 6347d197326b6c2d139eea126137ab32fdf139a8

Authored by Rafael Manzo
2 parents b8b42402 80951241

Merge pull request #151 from beatrizrezener/issue39

Acceptance tests for ReadingGroup destroying
features/mezuro_configuration/deletion.feature
... ... @@ -4,7 +4,7 @@ Feature: Configuration Deletion
4 4 The system should have an interface to it
5 5  
6 6 @kalibro_restart
7   - Scenario: Should not delete a configuration without user authetication
  7 + Scenario: Should not delete a configuration without user authentication
8 8 Given I have a sample configuration
9 9 When I am at the Sample Configuration page
10 10 Then I should not see Destroy
... ...
features/reading_group/delete.feature 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +Feature: Reading Group Deletion
  2 + In order to be able to remove a reading group
  3 + As a regular user
  4 + The system should have an interface to it
  5 +
  6 + @kalibro_restart
  7 + Scenario: Should not delete a reading group without user authentication
  8 + Given I have a sample reading group
  9 + When I visit the Sample Reading Group page
  10 + Then I should not see Destroy
  11 +
  12 + @kalibro_restart
  13 + Scenario: Should not delete a reading group that doesn't belongs to user
  14 + Given I am a regular user
  15 + And I am signed in
  16 + And I have a sample reading group
  17 + When I visit the Sample Reading Group page
  18 + Then I should not see Destroy
  19 +
  20 + @kalibro_restart
  21 + Scenario: Should delete a reading group that I own
  22 + Given I am a regular user
  23 + And I am signed in
  24 + And I own a sample reading group
  25 + And I visit the Sample Reading Group page
  26 + When I click the Destroy Reading Group link
  27 + Then I should see "New Reading Group"
  28 + And the Sample Reading Group should not be there
... ...
features/step_definitions/reading_group_steps.rb
... ... @@ -62,4 +62,8 @@ end
62 62  
63 63 Then(/^I should be in the Edit Reading Group page$/) do
64 64 visit edit_reading_group_path(@reading_group.id)
65   -end
66 65 \ No newline at end of file
  66 +end
  67 +
  68 +Then(/^the Sample Reading Group should not be there$/) do
  69 + expect { ReadingGroup.find(@reading_group.id) }.to raise_error
  70 +end
... ...