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,7 +19,7 @@ Feature: Reading Edit | ||
| 19 | And I should see "10.5" | 19 | And I should see "10.5" |
| 20 | And I should see "33dd33" | 20 | And I should see "33dd33" |
| 21 | 21 | ||
| 22 | - @kalibro_restart | 22 | + @kalibro_restart @wip |
| 23 | Scenario: editing a reading with blank fields | 23 | Scenario: editing a reading with blank fields |
| 24 | Given I am a regular user | 24 | Given I am a regular user |
| 25 | And I am signed in | 25 | And I am signed in |
| @@ -34,7 +34,7 @@ Feature: Reading Edit | @@ -34,7 +34,7 @@ Feature: Reading Edit | ||
| 34 | And I should see "Grade can't be blank" | 34 | And I should see "Grade can't be blank" |
| 35 | And I should see "Color can't be blank" | 35 | And I should see "Color can't be blank" |
| 36 | 36 | ||
| 37 | - @kalibro_restart | 37 | + @kalibro_restart @wip |
| 38 | Scenario: editing a reading with already taken name | 38 | Scenario: editing a reading with already taken name |
| 39 | Given I am a regular user | 39 | Given I am a regular user |
| 40 | And I am signed in | 40 | And I am signed in |
features/reading/new.feature
| 1 | -# TODO: refactor when the ReadingGroup get finished | ||
| 2 | Feature: New reading | 1 | Feature: New reading |
| 3 | In order to be able to create new readings | 2 | In order to be able to create new readings |
| 4 | As a metric specialist | 3 | As a metric specialist |
| 5 | I should be able to fill up a form with its informations and submit it | 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 | @kalibro_restart @wip | 18 | @kalibro_restart @wip |
| 8 | - Scenario: with valid fields | 19 | + Scenario: With valid fields |
| 9 | Given I am a regular user | 20 | Given I am a regular user |
| 10 | And I am signed in | 21 | And I am signed in |
| 11 | - And I have a sample reading group | 22 | + And I own a sample reading group |
| 12 | And I am at the New Reading page | 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 | @reading = FactoryGirl.create(:reading, {group_id: @reading_group.id, id: nil}) | 2 | @reading = FactoryGirl.create(:reading, {group_id: @reading_group.id, id: nil}) |
| 3 | end | 3 | end |
| 4 | 4 | ||
| 5 | Given(/^I am at the New Reading page$/) do | 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 | end | 7 | end |
| 8 | 8 | ||
| 9 | Given(/^I am at the Edit Reading page$/) do | 9 | Given(/^I am at the Edit Reading page$/) do |
| 10 | visit edit_reading_group_reading_url(@reading_group.id, @reading.id) | 10 | visit edit_reading_group_reading_url(@reading_group.id, @reading.id) |
| 11 | end | 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 | @reading = FactoryGirl.create(:reading, {label: label, group_id: @reading_group.id, id: nil}) | 14 | @reading = FactoryGirl.create(:reading, {label: label, group_id: @reading_group.id, id: nil}) |
| 15 | end | 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 |