Commit 57d0f6f48302aa2b166969a966676a1bc78de47b

Authored by Guilherme Rojas V. de Lima + Rafael Reggiani Manzo + João M. M. Silva
Committed by Rafael Manzo
1 parent 00991f2a

Project edition acceptance tests for visualization

features/project.feature
@@ -16,6 +16,7 @@ Feature: Project @@ -16,6 +16,7 @@ Feature: Project
16 Given I am at the All Projects page 16 Given I am at the All Projects page
17 Then I should not see New Project 17 Then I should not see New Project
18 18
  19 + @kalibro_restart
19 Scenario: Should list the existing projects 20 Scenario: Should list the existing projects
20 Given I am a regular user 21 Given I am a regular user
21 And I am signed in 22 And I am signed in
@@ -23,6 +24,7 @@ Feature: Project @@ -23,6 +24,7 @@ Feature: Project
23 And I am at the All Projects page 24 And I am at the All Projects page
24 Then the sample project should be there 25 Then the sample project should be there
25 26
  27 + @kalibro_restart
26 Scenario: Should show the existing project 28 Scenario: Should show the existing project
27 Given I am a regular user 29 Given I am a regular user
28 And I am signed in 30 And I am signed in
@@ -34,7 +36,7 @@ Feature: Project @@ -34,7 +36,7 @@ Feature: Project
34 And I should see Back 36 And I should see Back
35 And the sample project should be there 37 And the sample project should be there
36 38
37 - @wip 39 + @wip @kalibro_restart
38 Scenario: Should back to the All Projects page from show project view 40 Scenario: Should back to the All Projects page from show project view
39 Given I am a regular user 41 Given I am a regular user
40 And I am signed in 42 And I am signed in
@@ -42,3 +44,23 @@ Feature: Project @@ -42,3 +44,23 @@ Feature: Project
42 And I am at the Sample Project page 44 And I am at the Sample Project page
43 When I click the Back link 45 When I click the Back link
44 Then I should be in the All Projects page 46 Then I should be in the All Projects page
  47 +
  48 + @kalibro_restart
  49 + Scenario: Should go to edit form from All Projects page
  50 + Given I am a regular user
  51 + And I am signed in
  52 + And I have a sample project
  53 + And I am at the All Projects page
  54 + When I click the Edit link
  55 + Then I should be in the Edit Project page
  56 +
  57 + @kalibro_restart
  58 + Scenario: Should have the content filled in form
  59 + Given I am a regular user
  60 + And I am signed in
  61 + And I have a sample project
  62 + And I am at the All Projects page
  63 + When I click the Edit link
  64 + Then The field "project[name]" should be filled with the sample project "name"
  65 + And The field "project[description]" should be filled with the sample project "description"
  66 +
features/step_definitions/project_steps.rb
@@ -3,7 +3,7 @@ Given(/^I am at the All Projects page$/) do @@ -3,7 +3,7 @@ Given(/^I am at the All Projects page$/) do
3 end 3 end
4 4
5 Given(/^I have a sample project$/) do 5 Given(/^I have a sample project$/) do
6 - @project = FactoryGirl.create(:project) 6 + @project = FactoryGirl.create(:project, {id: nil})
7 end 7 end
8 8
9 Given(/^I am at the Sample Project page$/) do 9 Given(/^I am at the Sample Project page$/) do
@@ -22,3 +22,11 @@ end @@ -22,3 +22,11 @@ end
22 Then(/^I should be in the All Projects page$/) do 22 Then(/^I should be in the All Projects page$/) do
23 page.should have_content("Listing Projects") 23 page.should have_content("Listing Projects")
24 end 24 end
  25 +
  26 +Then(/^I should be in the Edit Project page$/) do
  27 + page.should have_content("Edit Project")
  28 +end
  29 +
  30 +Then(/^The field "(.*?)" should be filled with the sample project "(.*?)"$/) do |field, value|
  31 + page.find_field(field).value.should eq(@project.send(value))
  32 +end