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>
Gemfile.lock
1 1 GIT
2 2 remote: https://github.com/mezuro/kalibro_client
3   - revision: 6288c9bb83557f3ced7cc3cb20bc857c1a6166af
  3 + revision: 9688add754613bd497ec3e94d0cd568a3e5d4f2c
4 4 specs:
5 5 kalibro_client (0.0.1)
6 6 activesupport (>= 2.2.1)
... ...
app/models/repository.rb
1 1 class Repository < KalibroClient::Entities::Processor::Repository
  2 + include KalibroRecord
  3 +
2 4 def last_processing_of
3 5 if has_processing
4 6 last_processing
... ...
app/views/repositories/_form.html.erb
... ... @@ -42,7 +42,7 @@
42 42  
43 43 <div class="form-row">
44 44 <div class="field-container">
45   - <%= f.label :scm_type, class: 'control-label' %>
  45 + <%= f.label :scm_type, 'Type', class: 'control-label' %>
46 46 <%= f.select( :scm_type, @repository_types, class: 'tooltip-control' ) %>
47 47 </div>
48 48 <div class="help-container">
... ... @@ -66,8 +66,8 @@
66 66  
67 67 <div class="form-row">
68 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 71 </div>
72 72 <div class="help-container">
73 73 <p>
... ... @@ -78,9 +78,9 @@
78 78  
79 79 <div class="form-row">
80 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 84 </div>
85 85 <div class="help-container">
86 86 <p>
... ...
app/views/repositories/show.html.erb
... ... @@ -24,7 +24,7 @@
24 24  
25 25 <p>
26 26 <strong>Periodicity:</strong>
27   - <%= periodicity_option(@repository.process_period) %>
  27 + <%= periodicity_option(@repository.period) %>
28 28 </p>
29 29  
30 30 <p>
... ...
features/repository/create.feature
... ... @@ -16,7 +16,7 @@ Scenario: repository creation
16 16 And I set the select field "Type" as "GIT"
17 17 And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git"
18 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 20 When I press the Save button
21 21 Then I should see the saved repository's content
22 22  
... ... @@ -32,7 +32,7 @@ Scenario: repository creation blank validations
32 32 And I set the select field "License" as "ISC License (ISC)"
33 33 And I set the select field "Type" as "GIT"
34 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 36 When I press the Save button
37 37 Then I should see "Name can't be blank"
38 38 And I should see "Address can't be blank"
... ... @@ -51,6 +51,6 @@ Scenario: repository creation with name already taken
51 51 And I set the select field "Type" as "GIT"
52 52 And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git"
53 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 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 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 136 end
137 137  
138 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 140 expect(page).to have_content(@repository.description)
141 141 expect(page).to have_content(@repository.name)
142 142 expect(page).to have_content(@repository.license)
... ... @@ -165,7 +165,7 @@ end
165 165  
166 166 Then(/^I should see the saved repository's content$/) do
167 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 169 expect(page).to have_content(@repository.description)
170 170 expect(page).to have_content(@repository.name)
171 171 expect(page).to have_content(@repository.license)
... ...