diff --git a/features/mezuro_range/deletion.feature b/features/mezuro_range/deletion.feature new file mode 100644 index 0000000..464466e --- /dev/null +++ b/features/mezuro_range/deletion.feature @@ -0,0 +1,31 @@ +Feature: Range Deletion + In order to be able to remove a range + As a regular user + The system should have an interface to it + + @kalibro_restart + Scenario: Should delete a range that I own + Given I am a regular user + And I am signed in + And I own a sample configuration + And I have a sample reading group + And I have a sample metric configuration within the given mezuro configuration + And I have a sample reading within the sample reading group labeled "My Reading" + And I have a sample range within the sample metric configuration + And I am at the sample metric configuration page + When I click the Destroy Range link + Then I should be at metric configuration sample page + And I should see "There are no ranges yet!" + + @kalibro_restart @wip @javascript + Scenario: Should not see the destroy range link in the range that I not own + Given I am a regular user + And I am signed in + And I have a sample configuration + And I have a sample reading group + And I have a sample metric configuration within the given mezuro configuration + And I have a sample reading within the sample reading group labeled "My Reading" + And I have a sample range within the sample metric configuration + When I am at the sample metric configuration page + And I take a picture of the page + Then I should not see "Destroy Range" diff --git a/features/step_definitions/mezuro_range_steps.rb b/features/step_definitions/mezuro_range_steps.rb index c488af8..74081a2 100644 --- a/features/step_definitions/mezuro_range_steps.rb +++ b/features/step_definitions/mezuro_range_steps.rb @@ -3,6 +3,11 @@ Given(/^I have a sample range within the sample metric configuration with beginn reading_id: @reading.id, id: nil}) end +Given(/^I have a sample range within the sample metric configuration$/) do + @mezuro_range = FactoryGirl.create(:mezuro_range, {metric_configuration_id: @metric_configuration.id, + reading_id: @reading.id, id: nil}) +end + Then(/^I should be at the New Range page$/) do page.should have_content("New Range") page.should have_content("Beginning") -- libgit2 0.21.2