diff --git a/features/reading/edit.feature b/features/reading/edit.feature index 71edc49..32ff9e1 100644 --- a/features/reading/edit.feature +++ b/features/reading/edit.feature @@ -19,7 +19,7 @@ Feature: Reading Edit And I should see "10.5" And I should see "33dd33" - @kalibro_restart + @kalibro_restart @wip Scenario: editing a reading with blank fields Given I am a regular user And I am signed in @@ -34,7 +34,7 @@ Feature: Reading Edit And I should see "Grade can't be blank" And I should see "Color can't be blank" - @kalibro_restart + @kalibro_restart @wip Scenario: editing a reading with already taken name Given I am a regular user And I am signed in diff --git a/features/reading/new.feature b/features/reading/new.feature index f434f86..192e55e 100644 --- a/features/reading/new.feature +++ b/features/reading/new.feature @@ -1,17 +1,23 @@ -# TODO: refactor when the ReadingGroup get finished Feature: New reading In order to be able to create new readings As a metric specialist I should be able to fill up a form with its informations and submit it + @kalibro_restart + Scenario: Visiting reading creation page + Given I am a regular user + And I am signed in + And I own a sample reading group + And I visit the Sample Reading Group page + When I click the New Reading link + Then I should be at the New Reading page + And I should see "Label" + And I should see "Grade" + And I should see "Color" + @kalibro_restart @wip - Scenario: with valid fields + Scenario: With valid fields Given I am a regular user And I am signed in - And I have a sample reading group + And I own a sample reading group And I am at the New Reading page - And I fill the Label field with "Good" - And I fill the Grade field with "10" - And I fill the Color field with "00FF00" - When I press the Save button - Then I should see "Reading was successfully created" diff --git a/features/step_definitions/reading_steps.rb b/features/step_definitions/reading_steps.rb index eda4a1f..97e2797 100644 --- a/features/step_definitions/reading_steps.rb +++ b/features/step_definitions/reading_steps.rb @@ -1,15 +1,19 @@ -Given(/^I have a sample reading within the sample reading group$/) do +Given(/^I have a sample reading within the module result$/) do @reading = FactoryGirl.create(:reading, {group_id: @reading_group.id, id: nil}) end Given(/^I am at the New Reading page$/) do - visit new_reading_group_reading_url(@reading_group.id) + visit new_reading_group_reading_path(@reading_group.id) end Given(/^I am at the Edit Reading page$/) do visit edit_reading_group_reading_url(@reading_group.id, @reading.id) end -Given(/^I have a sample reading within the sample reading group labeled "(.*?)"$/) do |label| +Given(/^I have a sample reading within the module result labeled "(.*?)"$/) do |label| @reading = FactoryGirl.create(:reading, {label: label, group_id: @reading_group.id, id: nil}) end + +Then(/^I should be at the New Reading page$/) do + visit new_reading_group_reading_path(@reading_group.id) +end -- libgit2 0.21.2