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 16 Given I am at the All Projects page
17 17 Then I should not see New Project
18 18  
  19 + @kalibro_restart
19 20 Scenario: Should list the existing projects
20 21 Given I am a regular user
21 22 And I am signed in
... ... @@ -23,6 +24,7 @@ Feature: Project
23 24 And I am at the All Projects page
24 25 Then the sample project should be there
25 26  
  27 + @kalibro_restart
26 28 Scenario: Should show the existing project
27 29 Given I am a regular user
28 30 And I am signed in
... ... @@ -34,7 +36,7 @@ Feature: Project
34 36 And I should see Back
35 37 And the sample project should be there
36 38  
37   - @wip
  39 + @wip @kalibro_restart
38 40 Scenario: Should back to the All Projects page from show project view
39 41 Given I am a regular user
40 42 And I am signed in
... ... @@ -42,3 +44,23 @@ Feature: Project
42 44 And I am at the Sample Project page
43 45 When I click the Back link
44 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 3 end
4 4  
5 5 Given(/^I have a sample project$/) do
6   - @project = FactoryGirl.create(:project)
  6 + @project = FactoryGirl.create(:project, {id: nil})
7 7 end
8 8  
9 9 Given(/^I am at the Sample Project page$/) do
... ... @@ -22,3 +22,11 @@ end
22 22 Then(/^I should be in the All Projects page$/) do
23 23 page.should have_content("Listing Projects")
24 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
... ...