Commit e8cf8f91660d67c89da67aaea2a6556ad2e57d7b
1 parent
25de4137
Exists in
colab
and in
4 other branches
Acceptance tests for Mezuro Range edit feature.
Removed @wip from Mezuro Range deletion feature. signed-off-by: Renan Fichberg <rfichberg@gmail.com>
Showing
3 changed files
with
45 additions
and
2 deletions
Show diff stats
features/mezuro_range/deletion.feature
@@ -17,7 +17,7 @@ Feature: Range Deletion | @@ -17,7 +17,7 @@ Feature: Range Deletion | ||
17 | Then I should be at metric configuration sample page | 17 | Then I should be at metric configuration sample page |
18 | And I should see "There are no ranges yet!" | 18 | And I should see "There are no ranges yet!" |
19 | 19 | ||
20 | - @kalibro_restart @wip @javascript | 20 | + @kalibro_restart |
21 | Scenario: Should not see the destroy range link in the range that I not own | 21 | Scenario: Should not see the destroy range link in the range that I not own |
22 | Given I am a regular user | 22 | Given I am a regular user |
23 | And I am signed in | 23 | And I am signed in |
@@ -27,5 +27,4 @@ Feature: Range Deletion | @@ -27,5 +27,4 @@ Feature: Range Deletion | ||
27 | And I have a sample reading within the sample reading group labeled "My Reading" | 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 | 28 | And I have a sample range within the sample metric configuration |
29 | When I am at the sample metric configuration page | 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" | 30 | Then I should not see "Destroy Range" |
@@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
1 | +Feature: Mezuro Range Edit | ||
2 | + In Order to be able to update my mezuro range info | ||
3 | + As a regular user | ||
4 | + I should be able to edit my mezuro ranges | ||
5 | + | ||
6 | + @kalibro_restart | ||
7 | + Scenario: editing a mezuro range successfully | ||
8 | + Given I am a regular user | ||
9 | + And I am signed in | ||
10 | + And I own a sample configuration | ||
11 | + And I own 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 with beginning "1.1" | ||
15 | + And I am at the Edit Mezuro Range page | ||
16 | + And the select field "Reading" is set as "My Reading" | ||
17 | + And the field "Beginning" should be filled with "1.1" | ||
18 | + And the field "End" should be filled with "5.1" | ||
19 | + And the field "Comments" should be filled with "Comment" | ||
20 | + When I fill the Beginning field with "2.2" | ||
21 | + And I press the Save button | ||
22 | + Then I should see "2.2" | ||
23 | + | ||
24 | + @kalibro_restart | ||
25 | + Scenario: editing a mezuro range with blank fields | ||
26 | + Given I am a regular user | ||
27 | + And I am signed in | ||
28 | + And I own a sample configuration | ||
29 | + And I own a sample reading group | ||
30 | + And I have a sample metric configuration within the given mezuro configuration | ||
31 | + And I have a sample reading within the sample reading group labeled "My Reading" | ||
32 | + And I have a sample range within the sample metric configuration with beginning "1" | ||
33 | + And I am at the Edit Mezuro Range page | ||
34 | + When I fill the Beginning field with " " | ||
35 | + And I press the Save button | ||
36 | + Then I should see "Beginning can't be blank" |
features/step_definitions/mezuro_range_steps.rb
@@ -3,6 +3,14 @@ Given(/^I have a sample range within the sample metric configuration with beginn | @@ -3,6 +3,14 @@ Given(/^I have a sample range within the sample metric configuration with beginn | ||
3 | reading_id: @reading.id, id: nil}) | 3 | reading_id: @reading.id, id: nil}) |
4 | end | 4 | end |
5 | 5 | ||
6 | +Given(/^I am at the Edit Mezuro Range page$/) do | ||
7 | + visit edit_mezuro_configuration_metric_configuration_mezuro_range_path(@metric_configuration.configuration_id, @metric_configuration.id, @mezuro_range.id) | ||
8 | +end | ||
9 | + | ||
10 | +Given(/^the select field "(.*?)" is set as "(.*?)"$/) do |field, text| | ||
11 | + select text, from: field | ||
12 | +end | ||
13 | + | ||
6 | Given(/^I have a sample range within the sample metric configuration$/) do | 14 | 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, | 15 | @mezuro_range = FactoryGirl.create(:mezuro_range, {metric_configuration_id: @metric_configuration.id, |
8 | reading_id: @reading.id, id: nil}) | 16 | reading_id: @reading.id, id: nil}) |