Commit bce70a380181df717c46d4f7076e64a993d797c0

Authored by Rafael Manzo
1 parent 4be59d5e

Project acceptance tests are passing

app/models/project.rb
... ... @@ -5,6 +5,7 @@ class Project < KalibroClient::Entities::Processor::Project
5 5 end
6 6  
7 7 def attributes
8   - ProjectAttributes.find_by_project_id(self.id)
  8 + project_attributes = ProjectAttributes.find_by_project_id(self.id)
  9 + project_attributes.nil? ? ProjectAttributes.new : project_attributes
9 10 end
10 11 end
... ...
features/project/deletion.feature
... ... @@ -22,7 +22,7 @@ Feature: Project Deletion
22 22 Given I am a regular user
23 23 And I am signed in
24 24 And I own a sample project
25   - And I have a sample project_image
  25 + And I have sample project_attributes
26 26 And I am at the Sample Project page
27 27 When I click the Destroy Project link
28 28 Then I should be in the All Projects page
... ...
features/project/edition.feature
... ... @@ -8,7 +8,7 @@ Feature: Project
8 8 Given I am a regular user
9 9 And I am signed in
10 10 And I own a sample project
11   - And I have a sample project_image
  11 + And I have sample project_attributes
12 12 And I am at the All Projects page
13 13 When I click the Edit link
14 14 Then I should be in the Edit Project page
... ... @@ -35,7 +35,7 @@ Feature: Project
35 35 Given I am a regular user
36 36 And I am signed in
37 37 And I own a sample project
38   - And I have a sample project_image
  38 + And I have sample project_attributes
39 39 And I am at the All Projects page
40 40 When I click the Edit link
41 41 Then The field "project[name]" should be filled with the sample project "name"
... ... @@ -46,7 +46,7 @@ Feature: Project
46 46 Given I am a regular user
47 47 And I am signed in
48 48 And I own a sample project
49   - And I have a sample project_image
  49 + And I have sample project_attributes
50 50 And I am at the sample project edit page
51 51 And I fill the Name field with "Kalibro"
52 52 And I fill the Description field with "Web Service to collect metrics"
... ... @@ -61,7 +61,7 @@ Feature: Project
61 61 And I have a project named "Qt-Calculator"
62 62 And I own a project named "Kalibro"
63 63 And I am at the sample project edit page
64   - And I have a sample project_image
  64 + And I have sample project_attributes
65 65 And I fill the Name field with "Qt-Calculator"
66 66 When I press the Save button
67 67 Then I should see "Name has already been taken"
... ... @@ -71,7 +71,7 @@ Feature: Project
71 71 Given I am a regular user
72 72 And I am signed in
73 73 And I own a sample project
74   - And I have a sample project_image
  74 + And I have sample project_attributes
75 75 And I am at the sample project edit page
76 76 And I fill the Description field with "Web Service to collect metrics"
77 77 When I press the Save button
... ... @@ -82,7 +82,7 @@ Feature: Project
82 82 Given I am a regular user
83 83 And I am signed in
84 84 And I own a sample project
85   - And I have a sample project_image
  85 + And I have sample project_attributes
86 86 And I am at the sample project edit page
87 87 And I fill the Name field with " "
88 88 When I press the Save button
... ...
features/project/listing.feature
... ... @@ -25,7 +25,7 @@ Feature: Project listing
25 25 Given I am a regular user
26 26 And I am signed in
27 27 And I have a sample project
28   - And I have a sample project_image
  28 + And I have sample project_attributes
29 29 And I am at the All Projects page
30 30 When I click the Show link
31 31 Then the sample project should be there
32 32 \ No newline at end of file
... ...
features/project/show.feature
... ... @@ -7,7 +7,7 @@ Feature: Show Project
7 7 Scenario: Should not show the create repository link to user that doesn't own the project
8 8 Given I am a regular user
9 9 And I have a sample project
10   - And I have a sample project_image
  10 + And I have sample project_attributes
11 11 And I have a sample configuration with native metrics
12 12 And I have a sample repository within the sample project
13 13 When I am at the Sample Project page
... ... @@ -20,7 +20,7 @@ Scenario: Should show the create repository link the project owner
20 20 Given I am a regular user
21 21 And I am signed in
22 22 And I own a sample project
23   - And I have a sample project_image
  23 + And I have sample project_attributes
24 24 When I am at the Sample Project page
25 25 Then I should see "New Repository"
26 26  
... ... @@ -28,7 +28,7 @@ Scenario: Should show the create repository link the project owner
28 28 @kalibro_processor_restart
29 29 Scenario: Considering the project has no repositories
30 30 Given I have a sample project
31   - And I have a sample project_image
  31 + And I have sample project_attributes
32 32 When I am at the Sample Project page
33 33 Then I should see "There are no Repositories yet!"
34 34  
... ... @@ -43,6 +43,6 @@ Scenario: Considering the project has repositories
43 43 @kalibro_processor_restart
44 44 Scenario: Checking project contents
45 45 Given I have a sample project
46   - And I have a sample project_image
  46 + And I have sample project_attributes
47 47 When I am at the Sample Project page
48 48 Then the sample project should be there
... ...
features/step_definitions/project_steps.rb
... ... @@ -8,8 +8,8 @@ Given(/^I have a sample project$/) do
8 8 @project = FactoryGirl.create(:project)
9 9 end
10 10  
11   -Given(/^I have a sample project_image$/) do
12   - @project_image = FactoryGirl.create(:project_image, {id: nil})
  11 +Given(/^I have sample project_attributes$/) do
  12 + @project_attributes = FactoryGirl.create(:project_attributes, {id: nil})
13 13 end
14 14  
15 15 Given(/^I have a project named "(.*?)"$/) do |name|
... ... @@ -18,12 +18,12 @@ end
18 18  
19 19 Given(/^I own a sample project$/) do
20 20 @project = FactoryGirl.create(:project)
21   - FactoryGirl.create(:project_ownership, {user_id: @user.id, project_id: @project.id})
  21 + FactoryGirl.create(:project_attributes, {user_id: @user.id, project_id: @project.id})
22 22 end
23 23  
24 24 Given(/^I own a project named "(.*?)"$/) do |name|
25 25 @project = FactoryGirl.create(:project, {name: name})
26   - FactoryGirl.create(:project_ownership, {user_id: @user.id, project_id: @project.id})
  26 + FactoryGirl.create(:project_attributes, {user_id: @user.id, project_id: @project.id})
27 27 end
28 28  
29 29 Given(/^I am at the Sample Project page$/) do
... ...