Commit 536a0ac77bf8ddc6e5712672616155359c9e9af2

Authored by Renan Fichberg
Committed by Rafael Manzo
1 parent 4995fa60

Acceptance test for Range Destroy feature

signed-off-by: Fellipe Souto Sampaio <fllsouto@gmail.com>
features/mezuro_range/deletion.feature 0 → 100644
... ... @@ -0,0 +1,31 @@
  1 +Feature: Range Deletion
  2 + In order to be able to remove a range
  3 + As a regular user
  4 + The system should have an interface to it
  5 +
  6 + @kalibro_restart
  7 + Scenario: Should delete a range that I own
  8 + Given I am a regular user
  9 + And I am signed in
  10 + And I own a sample configuration
  11 + And I have a sample reading group
  12 + And I have a sample metric configuration within the given mezuro configuration
  13 + And I have a sample reading within the sample reading group labeled "My Reading"
  14 + And I have a sample range within the sample metric configuration
  15 + And I am at the sample metric configuration page
  16 + When I click the Destroy Range link
  17 + Then I should be at metric configuration sample page
  18 + And I should see "There are no ranges yet!"
  19 +
  20 + @kalibro_restart @wip @javascript
  21 + Scenario: Should not see the destroy range link in the range that I not own
  22 + Given I am a regular user
  23 + And I am signed in
  24 + And I have a sample configuration
  25 + And I have a sample reading group
  26 + And I have a sample metric configuration within the given mezuro configuration
  27 + And I have a sample reading within the sample reading group labeled "My Reading"
  28 + And I have a sample range within the sample metric configuration
  29 + When I am at the sample metric configuration page
  30 + And I take a picture of the page
  31 + Then I should not see "Destroy Range"
... ...
features/step_definitions/mezuro_range_steps.rb
... ... @@ -3,6 +3,11 @@ Given(/^I have a sample range within the sample metric configuration with beginn
3 3 reading_id: @reading.id, id: nil})
4 4 end
5 5  
  6 +Given(/^I have a sample range within the sample metric configuration$/) do
  7 + @mezuro_range = FactoryGirl.create(:mezuro_range, {metric_configuration_id: @metric_configuration.id,
  8 + reading_id: @reading.id, id: nil})
  9 +end
  10 +
6 11 Then(/^I should be at the New Range page$/) do
7 12 page.should have_content("New Range")
8 13 page.should have_content("Beginning")
... ...