Commit 19edc2321b4b87a70fd05c7b5016253646ed3568

Authored by Heitor
Committed by Rafael Manzo
1 parent 9176570d

Fixing repository creation acceptance tests

Signed off by: Daniel Alves <danpaulalves@gmail.com>
1 GIT 1 GIT
2 remote: https://github.com/mezuro/kalibro_client 2 remote: https://github.com/mezuro/kalibro_client
3 - revision: 6288c9bb83557f3ced7cc3cb20bc857c1a6166af 3 + revision: 9688add754613bd497ec3e94d0cd568a3e5d4f2c
4 specs: 4 specs:
5 kalibro_client (0.0.1) 5 kalibro_client (0.0.1)
6 activesupport (>= 2.2.1) 6 activesupport (>= 2.2.1)
app/models/repository.rb
1 class Repository < KalibroClient::Entities::Processor::Repository 1 class Repository < KalibroClient::Entities::Processor::Repository
  2 + include KalibroRecord
  3 +
2 def last_processing_of 4 def last_processing_of
3 if has_processing 5 if has_processing
4 last_processing 6 last_processing
app/views/repositories/_form.html.erb
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 42
43 <div class="form-row"> 43 <div class="form-row">
44 <div class="field-container"> 44 <div class="field-container">
45 - <%= f.label :scm_type, class: 'control-label' %> 45 + <%= f.label :scm_type, 'Type', class: 'control-label' %>
46 <%= f.select( :scm_type, @repository_types, class: 'tooltip-control' ) %> 46 <%= f.select( :scm_type, @repository_types, class: 'tooltip-control' ) %>
47 </div> 47 </div>
48 <div class="help-container"> 48 <div class="help-container">
@@ -66,8 +66,8 @@ @@ -66,8 +66,8 @@
66 66
67 <div class="form-row"> 67 <div class="form-row">
68 <div class="field-container"> 68 <div class="field-container">
69 - <%= f.label :process_period, 'Process Period', class: 'control-label' %>  
70 - <%= f.select( :process_period, periodicity_options, class: 'tooltip-control' ) %> 69 + <%= f.label :period, 'Process Period', class: 'control-label' %>
  70 + <%= f.select( :period, periodicity_options, class: 'tooltip-control' ) %>
71 </div> 71 </div>
72 <div class="help-container"> 72 <div class="help-container">
73 <p> 73 <p>
@@ -78,9 +78,9 @@ @@ -78,9 +78,9 @@
78 78
79 <div class="form-row"> 79 <div class="form-row">
80 <div class="field-container"> 80 <div class="field-container">
81 - <%= f.label :configuration, class: 'control-label' %>  
82 - <% configuration_list = KalibroGatekeeperClient::Entities::Configuration.all.map { |conf| [conf.name, conf.id] } %>  
83 - <%= f.select( :configuration_id, configuration_list, class: 'tooltip-control' ) %> 81 + <%= f.label :configuration, 'Configuration', class: 'control-label' %>
  82 + <% configuration_list = KalibroClient::Entities::Configurations::KalibroConfiguration.all.map { |conf| [conf.name, conf.id] } %>
  83 + <%= f.select( :kalibro_configuration_id, configuration_list, class: 'tooltip-control' ) %>
84 </div> 84 </div>
85 <div class="help-container"> 85 <div class="help-container">
86 <p> 86 <p>
app/views/repositories/show.html.erb
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 24
25 <p> 25 <p>
26 <strong>Periodicity:</strong> 26 <strong>Periodicity:</strong>
27 - <%= periodicity_option(@repository.process_period) %> 27 + <%= periodicity_option(@repository.period) %>
28 </p> 28 </p>
29 29
30 <p> 30 <p>
features/repository/create.feature
@@ -16,7 +16,7 @@ Scenario: repository creation @@ -16,7 +16,7 @@ Scenario: repository creation
16 And I set the select field "Type" as "GIT" 16 And I set the select field "Type" as "GIT"
17 And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git" 17 And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git"
18 And I set the select field "Process Period" as "1 day" 18 And I set the select field "Process Period" as "1 day"
19 - And I set the select field "repository_configuration_id" as "Java" 19 + And I set the select field "repository_kalibro_configuration_id" as "Java"
20 When I press the Save button 20 When I press the Save button
21 Then I should see the saved repository's content 21 Then I should see the saved repository's content
22 22
@@ -32,7 +32,7 @@ Scenario: repository creation blank validations @@ -32,7 +32,7 @@ Scenario: repository creation blank validations
32 And I set the select field "License" as "ISC License (ISC)" 32 And I set the select field "License" as "ISC License (ISC)"
33 And I set the select field "Type" as "GIT" 33 And I set the select field "Type" as "GIT"
34 And I set the select field "Process Period" as "1 day" 34 And I set the select field "Process Period" as "1 day"
35 - And I set the select field "repository_configuration_id" as "Java" 35 + And I set the select field "repository_kalibro_configuration_id" as "Java"
36 When I press the Save button 36 When I press the Save button
37 Then I should see "Name can't be blank" 37 Then I should see "Name can't be blank"
38 And I should see "Address can't be blank" 38 And I should see "Address can't be blank"
@@ -51,6 +51,6 @@ Scenario: repository creation with name already taken @@ -51,6 +51,6 @@ Scenario: repository creation with name already taken
51 And I set the select field "Type" as "GIT" 51 And I set the select field "Type" as "GIT"
52 And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git" 52 And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git"
53 And I set the select field "Process Period" as "1 day" 53 And I set the select field "Process Period" as "1 day"
54 - And I set the select field "repository_configuration_id" as "Java" 54 + And I set the select field "repository_kalibro_configuration_id" as "Java"
55 When I press the Save button 55 When I press the Save button
56 - Then I should see "Name There is already a Repository with name KalibroEntities! Please, choose another one."  
57 \ No newline at end of file 56 \ No newline at end of file
  57 + Then I should see "Name should be unique within project"
features/step_definitions/repository_steps.rb
@@ -136,7 +136,7 @@ Then(/^I should see a sample child&#39;s name$/) do @@ -136,7 +136,7 @@ Then(/^I should see a sample child&#39;s name$/) do
136 end 136 end
137 137
138 Then(/^I should see the given repository's content$/) do 138 Then(/^I should see the given repository's content$/) do
139 - expect(page).to have_content(@repository.type) 139 + expect(page).to have_content(@repository.scm_type)
140 expect(page).to have_content(@repository.description) 140 expect(page).to have_content(@repository.description)
141 expect(page).to have_content(@repository.name) 141 expect(page).to have_content(@repository.name)
142 expect(page).to have_content(@repository.license) 142 expect(page).to have_content(@repository.license)
@@ -165,7 +165,7 @@ end @@ -165,7 +165,7 @@ end
165 165
166 Then(/^I should see the saved repository's content$/) do 166 Then(/^I should see the saved repository's content$/) do
167 @repository = Repository.all.last # suposing the last repository created is the only created too. 167 @repository = Repository.all.last # suposing the last repository created is the only created too.
168 - expect(page).to have_content(@repository.type) 168 + expect(page).to have_content(@repository.scm_type)
169 expect(page).to have_content(@repository.description) 169 expect(page).to have_content(@repository.description)
170 expect(page).to have_content(@repository.name) 170 expect(page).to have_content(@repository.name)
171 expect(page).to have_content(@repository.license) 171 expect(page).to have_content(@repository.license)