Commit 166bfc4176d195627d8105dee6005f8e071cf96e
Committed by
Rafael Manzo
1 parent
8a4ffbeb
Exists in
colab
and in
4 other branches
New reading acceptance test
Missing the other ones Signed-of By: Renan Fichberg <rfichberg@gmail.com>
Showing
3 changed files
with
23 additions
and
13 deletions
Show diff stats
features/reading/edit.feature
| ... | ... | @@ -19,7 +19,7 @@ Feature: Reading Edit |
| 19 | 19 | And I should see "10.5" |
| 20 | 20 | And I should see "33dd33" |
| 21 | 21 | |
| 22 | - @kalibro_restart | |
| 22 | + @kalibro_restart @wip | |
| 23 | 23 | Scenario: editing a reading with blank fields |
| 24 | 24 | Given I am a regular user |
| 25 | 25 | And I am signed in |
| ... | ... | @@ -34,7 +34,7 @@ Feature: Reading Edit |
| 34 | 34 | And I should see "Grade can't be blank" |
| 35 | 35 | And I should see "Color can't be blank" |
| 36 | 36 | |
| 37 | - @kalibro_restart | |
| 37 | + @kalibro_restart @wip | |
| 38 | 38 | Scenario: editing a reading with already taken name |
| 39 | 39 | Given I am a regular user |
| 40 | 40 | And I am signed in | ... | ... |
features/reading/new.feature
| 1 | -# TODO: refactor when the ReadingGroup get finished | |
| 2 | 1 | Feature: New reading |
| 3 | 2 | In order to be able to create new readings |
| 4 | 3 | As a metric specialist |
| 5 | 4 | I should be able to fill up a form with its informations and submit it |
| 6 | 5 | |
| 6 | + @kalibro_restart | |
| 7 | + Scenario: Visiting reading creation page | |
| 8 | + Given I am a regular user | |
| 9 | + And I am signed in | |
| 10 | + And I own a sample reading group | |
| 11 | + And I visit the Sample Reading Group page | |
| 12 | + When I click the New Reading link | |
| 13 | + Then I should be at the New Reading page | |
| 14 | + And I should see "Label" | |
| 15 | + And I should see "Grade" | |
| 16 | + And I should see "Color" | |
| 17 | + | |
| 7 | 18 | @kalibro_restart @wip |
| 8 | - Scenario: with valid fields | |
| 19 | + Scenario: With valid fields | |
| 9 | 20 | Given I am a regular user |
| 10 | 21 | And I am signed in |
| 11 | - And I have a sample reading group | |
| 22 | + And I own a sample reading group | |
| 12 | 23 | And I am at the New Reading page |
| 13 | - And I fill the Label field with "Good" | |
| 14 | - And I fill the Grade field with "10" | |
| 15 | - And I fill the Color field with "00FF00" | |
| 16 | - When I press the Save button | |
| 17 | - Then I should see "Reading was successfully created" | ... | ... |
features/step_definitions/reading_steps.rb
| 1 | -Given(/^I have a sample reading within the sample reading group$/) do | |
| 1 | +Given(/^I have a sample reading within the module result$/) do | |
| 2 | 2 | @reading = FactoryGirl.create(:reading, {group_id: @reading_group.id, id: nil}) |
| 3 | 3 | end |
| 4 | 4 | |
| 5 | 5 | Given(/^I am at the New Reading page$/) do |
| 6 | - visit new_reading_group_reading_url(@reading_group.id) | |
| 6 | + visit new_reading_group_reading_path(@reading_group.id) | |
| 7 | 7 | end |
| 8 | 8 | |
| 9 | 9 | Given(/^I am at the Edit Reading page$/) do |
| 10 | 10 | visit edit_reading_group_reading_url(@reading_group.id, @reading.id) |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | -Given(/^I have a sample reading within the sample reading group labeled "(.*?)"$/) do |label| | |
| 13 | +Given(/^I have a sample reading within the module result labeled "(.*?)"$/) do |label| | |
| 14 | 14 | @reading = FactoryGirl.create(:reading, {label: label, group_id: @reading_group.id, id: nil}) |
| 15 | 15 | end |
| 16 | + | |
| 17 | +Then(/^I should be at the New Reading page$/) do | |
| 18 | + visit new_reading_group_reading_path(@reading_group.id) | |
| 19 | +end | ... | ... |