diff --git a/features/project.feature b/features/project.feature index 9d0209d..a07daa2 100644 --- a/features/project.feature +++ b/features/project.feature @@ -16,6 +16,7 @@ Feature: Project Given I am at the All Projects page Then I should not see New Project + @kalibro_restart Scenario: Should list the existing projects Given I am a regular user And I am signed in @@ -23,6 +24,7 @@ Feature: Project And I am at the All Projects page Then the sample project should be there + @kalibro_restart Scenario: Should show the existing project Given I am a regular user And I am signed in @@ -34,7 +36,7 @@ Feature: Project And I should see Back And the sample project should be there - @wip + @wip @kalibro_restart Scenario: Should back to the All Projects page from show project view Given I am a regular user And I am signed in @@ -42,3 +44,23 @@ Feature: Project And I am at the Sample Project page When I click the Back link Then I should be in the All Projects page + + @kalibro_restart + Scenario: Should go to edit form from All Projects page + Given I am a regular user + And I am signed in + And I have a sample project + And I am at the All Projects page + When I click the Edit link + Then I should be in the Edit Project page + + @kalibro_restart + Scenario: Should have the content filled in form + Given I am a regular user + And I am signed in + And I have a sample project + And I am at the All Projects page + When I click the Edit link + Then The field "project[name]" should be filled with the sample project "name" + And The field "project[description]" should be filled with the sample project "description" + diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 9147d5c..27400e6 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -3,7 +3,7 @@ Given(/^I am at the All Projects page$/) do end Given(/^I have a sample project$/) do - @project = FactoryGirl.create(:project) + @project = FactoryGirl.create(:project, {id: nil}) end Given(/^I am at the Sample Project page$/) do @@ -22,3 +22,11 @@ end Then(/^I should be in the All Projects page$/) do page.should have_content("Listing Projects") end + +Then(/^I should be in the Edit Project page$/) do + page.should have_content("Edit Project") +end + +Then(/^The field "(.*?)" should be filled with the sample project "(.*?)"$/) do |field, value| + page.find_field(field).value.should eq(@project.send(value)) +end -- libgit2 0.21.2