Commit 85e76eb7542a84c8ab299ddb9cdd1c03e3afb5f1
Committed by
Rafael Manzo
1 parent
bf2050c9
Exists in
colab
and in
4 other branches
WIP - GatekeeperClient migration
signed-off-by: Fellipe Souto Sampaio <fllsouto@gmail.com> signed-off-by: Diego Araújo <diegoamc90@gmail.com> signed-off-by: Alessandro Palmeira <alessandro.palmeira@gmail.com>
Showing
27 changed files
with
50 additions
and
66 deletions
Show diff stats
Gemfile
@@ -34,7 +34,7 @@ gem 'jbuilder', '~> 2.0.4' | @@ -34,7 +34,7 @@ gem 'jbuilder', '~> 2.0.4' | ||
34 | gem 'devise', '~> 3.2.4' | 34 | gem 'devise', '~> 3.2.4' |
35 | 35 | ||
36 | # Kalibro integration | 36 | # Kalibro integration |
37 | -gem 'kalibro_gem', "~> 0.0.1.rc18" | 37 | +gem 'kalibro_gatekeeper_client', "~> 0.0.1.rc1" |
38 | 38 | ||
39 | # PostgreSQL integration | 39 | # PostgreSQL integration |
40 | gem "pg", "~> 0.17.0" | 40 | gem "pg", "~> 0.17.0" |
Gemfile.lock
@@ -25,9 +25,6 @@ GEM | @@ -25,9 +25,6 @@ GEM | ||
25 | multi_json (~> 1.3) | 25 | multi_json (~> 1.3) |
26 | thread_safe (~> 0.1) | 26 | thread_safe (~> 0.1) |
27 | tzinfo (~> 0.3.37) | 27 | tzinfo (~> 0.3.37) |
28 | - akami (1.2.1) | ||
29 | - gyoku (>= 0.4.0) | ||
30 | - nokogiri | ||
31 | arel (4.0.2) | 28 | arel (4.0.2) |
32 | atomic (1.1.16) | 29 | atomic (1.1.16) |
33 | bcrypt (3.1.7) | 30 | bcrypt (3.1.7) |
@@ -103,14 +100,13 @@ GEM | @@ -103,14 +100,13 @@ GEM | ||
103 | factory_girl_rails (4.4.1) | 100 | factory_girl_rails (4.4.1) |
104 | factory_girl (~> 4.4.0) | 101 | factory_girl (~> 4.4.0) |
105 | railties (>= 3.0.0) | 102 | railties (>= 3.0.0) |
103 | + faraday (0.8.9) | ||
104 | + multipart-post (~> 1.2.0) | ||
105 | + faraday_middleware (0.9.0) | ||
106 | + faraday (>= 0.7.4, < 0.9) | ||
106 | gherkin (2.12.2) | 107 | gherkin (2.12.2) |
107 | multi_json (~> 1.3) | 108 | multi_json (~> 1.3) |
108 | - gyoku (1.1.1) | ||
109 | - builder (>= 2.1.2) | ||
110 | hike (1.2.3) | 109 | hike (1.2.3) |
111 | - httpi (2.1.0) | ||
112 | - rack | ||
113 | - rubyntlm (~> 0.3.2) | ||
114 | i18n (0.6.9) | 110 | i18n (0.6.9) |
115 | jbuilder (2.0.5) | 111 | jbuilder (2.0.5) |
116 | activesupport (>= 3.0.0) | 112 | activesupport (>= 3.0.0) |
@@ -121,9 +117,9 @@ GEM | @@ -121,9 +117,9 @@ GEM | ||
121 | jquery-ui-rails (4.2.0) | 117 | jquery-ui-rails (4.2.0) |
122 | railties (>= 3.2.16) | 118 | railties (>= 3.2.16) |
123 | json (1.8.1) | 119 | json (1.8.1) |
124 | - kalibro_gem (0.0.1) | ||
125 | - activesupport (~> 4.0.2) | ||
126 | - savon (~> 2.3.3) | 120 | + kalibro_gatekeeper_client (0.0.1.rc1) |
121 | + activesupport (>= 2.2.1) | ||
122 | + faraday_middleware (~> 0.9.0) | ||
127 | konacha (3.2.1) | 123 | konacha (3.2.1) |
128 | actionpack (>= 3.1, < 5) | 124 | actionpack (>= 3.1, < 5) |
129 | capybara | 125 | capybara |
@@ -143,12 +139,12 @@ GEM | @@ -143,12 +139,12 @@ GEM | ||
143 | modernizr-rails (2.7.1) | 139 | modernizr-rails (2.7.1) |
144 | multi_json (1.9.2) | 140 | multi_json (1.9.2) |
145 | multi_test (0.1.1) | 141 | multi_test (0.1.1) |
142 | + multipart-post (1.2.0) | ||
146 | net-scp (1.1.2) | 143 | net-scp (1.1.2) |
147 | net-ssh (>= 2.6.5) | 144 | net-ssh (>= 2.6.5) |
148 | net-ssh (2.8.0) | 145 | net-ssh (2.8.0) |
149 | nokogiri (1.6.1) | 146 | nokogiri (1.6.1) |
150 | mini_portile (~> 0.5.0) | 147 | mini_portile (~> 0.5.0) |
151 | - nori (2.3.0) | ||
152 | orm_adapter (0.5.0) | 148 | orm_adapter (0.5.0) |
153 | pg (0.17.1) | 149 | pg (0.17.1) |
154 | poltergeist (1.5.0) | 150 | poltergeist (1.5.0) |
@@ -191,21 +187,12 @@ GEM | @@ -191,21 +187,12 @@ GEM | ||
191 | rspec-core (~> 2.14.0) | 187 | rspec-core (~> 2.14.0) |
192 | rspec-expectations (~> 2.14.0) | 188 | rspec-expectations (~> 2.14.0) |
193 | rspec-mocks (~> 2.14.0) | 189 | rspec-mocks (~> 2.14.0) |
194 | - rubyntlm (0.3.4) | ||
195 | sass (3.2.18) | 190 | sass (3.2.18) |
196 | sass-rails (4.0.2) | 191 | sass-rails (4.0.2) |
197 | railties (>= 4.0.0, < 5.0) | 192 | railties (>= 4.0.0, < 5.0) |
198 | sass (~> 3.2.0) | 193 | sass (~> 3.2.0) |
199 | sprockets (~> 2.8, <= 2.11.0) | 194 | sprockets (~> 2.8, <= 2.11.0) |
200 | sprockets-rails (~> 2.0.0) | 195 | sprockets-rails (~> 2.0.0) |
201 | - savon (2.3.3) | ||
202 | - akami (~> 1.2.0) | ||
203 | - builder (>= 2.1.2) | ||
204 | - gyoku (~> 1.1.0) | ||
205 | - httpi (~> 2.1.0) | ||
206 | - nokogiri (>= 1.4.0) | ||
207 | - nori (~> 2.3.0) | ||
208 | - wasabi (~> 3.2.2) | ||
209 | sdoc (0.4.0) | 196 | sdoc (0.4.0) |
210 | json (~> 1.8) | 197 | json (~> 1.8) |
211 | rdoc (~> 4.0, < 5.0) | 198 | rdoc (~> 4.0, < 5.0) |
@@ -256,10 +243,6 @@ GEM | @@ -256,10 +243,6 @@ GEM | ||
256 | json (>= 1.8.0) | 243 | json (>= 1.8.0) |
257 | warden (1.2.3) | 244 | warden (1.2.3) |
258 | rack (>= 1.0) | 245 | rack (>= 1.0) |
259 | - wasabi (3.2.3) | ||
260 | - httpi (~> 2.0) | ||
261 | - mime-types (< 2.0.0) | ||
262 | - nokogiri (>= 1.4.0) | ||
263 | websocket-driver (0.3.2) | 246 | websocket-driver (0.3.2) |
264 | xpath (2.0.0) | 247 | xpath (2.0.0) |
265 | nokogiri (~> 1.3) | 248 | nokogiri (~> 1.3) |
@@ -285,7 +268,7 @@ DEPENDENCIES | @@ -285,7 +268,7 @@ DEPENDENCIES | ||
285 | jbuilder (~> 2.0.4) | 268 | jbuilder (~> 2.0.4) |
286 | jquery-rails | 269 | jquery-rails |
287 | jquery-ui-rails (~> 4.2.0) | 270 | jquery-ui-rails (~> 4.2.0) |
288 | - kalibro_gem (~> 0.0.1.rc18) | 271 | + kalibro_gatekeeper_client (~> 0.0.1.rc1) |
289 | konacha (~> 3.2.0) | 272 | konacha (~> 3.2.0) |
290 | mocha | 273 | mocha |
291 | modernizr-rails | 274 | modernizr-rails |
app/controllers/metric_configurations_controller.rb
@@ -10,7 +10,7 @@ class MetricConfigurationsController < ApplicationController | @@ -10,7 +10,7 @@ class MetricConfigurationsController < ApplicationController | ||
10 | def choose_metric | 10 | def choose_metric |
11 | @mezuro_configuration_id = params[:mezuro_configuration_id].to_i | 11 | @mezuro_configuration_id = params[:mezuro_configuration_id].to_i |
12 | @metric_configuration_id = params[:metric_configuration_id].to_i | 12 | @metric_configuration_id = params[:metric_configuration_id].to_i |
13 | - @base_tools = KalibroGem::Entities::BaseTool.all | 13 | + @base_tools = KalibroGatekeeperClient::Entities::BaseTool.all |
14 | @exist_metric = params[:exist_metric] | 14 | @exist_metric = params[:exist_metric] |
15 | end | 15 | end |
16 | 16 | ||
@@ -18,13 +18,13 @@ class MetricConfigurationsController < ApplicationController | @@ -18,13 +18,13 @@ class MetricConfigurationsController < ApplicationController | ||
18 | @metric_configuration = MetricConfiguration.new | 18 | @metric_configuration = MetricConfiguration.new |
19 | @metric_configuration.configuration_id = params[:mezuro_configuration_id].to_i | 19 | @metric_configuration.configuration_id = params[:mezuro_configuration_id].to_i |
20 | @metric_configuration.base_tool_name = params[:base_tool_name] | 20 | @metric_configuration.base_tool_name = params[:base_tool_name] |
21 | - @metric_configuration.metric = KalibroGem::Entities::BaseTool.find_by_name(params[:base_tool_name]).metric params[:metric_name] | 21 | + @metric_configuration.metric = KalibroGatekeeperClient::Entities::BaseTool.find_by_name(params[:base_tool_name]).metric params[:metric_name] |
22 | end | 22 | end |
23 | 23 | ||
24 | def create | 24 | def create |
25 | @metric_configuration = MetricConfiguration.new(metric_configuration_params) | 25 | @metric_configuration = MetricConfiguration.new(metric_configuration_params) |
26 | @metric_configuration.configuration_id = params[:mezuro_configuration_id].to_i | 26 | @metric_configuration.configuration_id = params[:mezuro_configuration_id].to_i |
27 | - @metric_configuration.metric = KalibroGem::Entities::BaseTool.find_by_name(params[:base_tool_name]).metric params[:metric_name] | 27 | + @metric_configuration.metric = KalibroGatekeeperClient::Entities::BaseTool.find_by_name(params[:base_tool_name]).metric params[:metric_name] |
28 | @metric_configuration.base_tool_name = params[:base_tool_name] | 28 | @metric_configuration.base_tool_name = params[:base_tool_name] |
29 | respond_to do |format| | 29 | respond_to do |format| |
30 | create_and_redir(format) | 30 | create_and_redir(format) |
app/models/date_module_result.rb
app/models/metric_configuration.rb
1 | require "validators/code_uniqueness_validator.rb" | 1 | require "validators/code_uniqueness_validator.rb" |
2 | 2 | ||
3 | -class MetricConfiguration < KalibroGem::Entities::MetricConfiguration | 3 | +class MetricConfiguration < KalibroGatekeeperClient::Entities::MetricConfiguration |
4 | include KalibroRecord | 4 | include KalibroRecord |
5 | 5 | ||
6 | attr_accessor :code, :weight, :aggregation_form | 6 | attr_accessor :code, :weight, :aggregation_form |
app/models/mezuro_configuration.rb
1 | require "validators/kalibro_uniqueness_validator.rb" | 1 | require "validators/kalibro_uniqueness_validator.rb" |
2 | 2 | ||
3 | -class MezuroConfiguration < KalibroGem::Entities::Configuration | 3 | +class MezuroConfiguration < KalibroGatekeeperClient::Entities::Configuration |
4 | include KalibroRecord | 4 | include KalibroRecord |
5 | 5 | ||
6 | attr_accessor :name | 6 | attr_accessor :name |
app/models/mezuro_range.rb
1 | require "validators/beginning_uniqueness_validator.rb" | 1 | require "validators/beginning_uniqueness_validator.rb" |
2 | 2 | ||
3 | -class MezuroRange < KalibroGem::Entities::Range | 3 | +class MezuroRange < KalibroGatekeeperClient::Entities::Range |
4 | include KalibroRecord | 4 | include KalibroRecord |
5 | 5 | ||
6 | attr_accessor :beginning, :end, :reading_id, :mezuro_configuration_id, :comments | 6 | attr_accessor :beginning, :end, :reading_id, :mezuro_configuration_id, :comments |
app/models/module_result.rb
1 | -class ModuleResult < KalibroGem::Entities::ModuleResult | 1 | +class ModuleResult < KalibroGatekeeperClient::Entities::ModuleResult |
2 | include KalibroRecord | 2 | include KalibroRecord |
3 | 3 | ||
4 | def metric_results | 4 | def metric_results |
5 | - KalibroGem::Entities::MetricResult.metric_results_of(@id) | 5 | + KalibroGatekeeperClient::Entities::MetricResult.metric_results_of(@id) |
6 | end | 6 | end |
7 | 7 | ||
8 | def history | 8 | def history |
app/models/processing.rb
app/models/project.rb
1 | require "validators/kalibro_uniqueness_validator.rb" | 1 | require "validators/kalibro_uniqueness_validator.rb" |
2 | 2 | ||
3 | -class Project < KalibroGem::Entities::Project | 3 | +class Project < KalibroGatekeeperClient::Entities::Project |
4 | include KalibroRecord | 4 | include KalibroRecord |
5 | 5 | ||
6 | attr_accessor :name | 6 | attr_accessor :name |
app/models/reading.rb
app/models/reading_group.rb
1 | require "validators/kalibro_uniqueness_validator.rb" | 1 | require "validators/kalibro_uniqueness_validator.rb" |
2 | 2 | ||
3 | -class ReadingGroup < KalibroGem::Entities::ReadingGroup | 3 | +class ReadingGroup < KalibroGatekeeperClient::Entities::ReadingGroup |
4 | include KalibroRecord | 4 | include KalibroRecord |
5 | 5 | ||
6 | attr_accessor :name | 6 | attr_accessor :name |
app/models/repository.rb
app/views/repositories/_form.html.erb
@@ -32,7 +32,8 @@ | @@ -32,7 +32,8 @@ | ||
32 | 32 | ||
33 | <div class="form-group"> | 33 | <div class="form-group"> |
34 | <%= f.label :configuration, class: 'control-label' %> | 34 | <%= f.label :configuration, class: 'control-label' %> |
35 | - <% configuration_list = KalibroGem::Entities::Configuration.all.map { |conf| [conf.name, conf.id] } %> | 35 | + <% configuration_list = KalibroGatekeeperClient::Entities::Configuration.all.map { |conf| [conf.name, conf.id] } %> |
36 | + <% p configuration_list %> | ||
36 | <%= f.select( :configuration_id, configuration_list, {class: 'form-control'} ) %> | 37 | <%= f.select( :configuration_id, configuration_list, {class: 'form-control'} ) %> |
37 | </div></br> | 38 | </div></br> |
38 | 39 |
features/repository/create.feature
@@ -3,7 +3,7 @@ Feature: Repository Creation | @@ -3,7 +3,7 @@ Feature: Repository Creation | ||
3 | As a regular user | 3 | As a regular user |
4 | I should be able to create repositories | 4 | I should be able to create repositories |
5 | 5 | ||
6 | -@kalibro_restart | 6 | +@kalibro_restart @javascript |
7 | Scenario: repository creation | 7 | Scenario: repository creation |
8 | Given I am a regular user | 8 | Given I am a regular user |
9 | And I am signed in | 9 | And I am signed in |
@@ -20,7 +20,7 @@ Scenario: repository creation | @@ -20,7 +20,7 @@ Scenario: repository creation | ||
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 | ||
23 | -@kalibro_restart | 23 | +@kalibro_restart @javascript |
24 | Scenario: repository creation blank validations | 24 | Scenario: repository creation blank validations |
25 | Given I am a regular user | 25 | Given I am a regular user |
26 | And I am signed in | 26 | And I am signed in |
@@ -35,7 +35,7 @@ Scenario: repository creation blank validations | @@ -35,7 +35,7 @@ Scenario: repository creation blank validations | ||
35 | Then I should see "Name can't be blank" | 35 | Then I should see "Name can't be blank" |
36 | And I should see "Address can't be blank" | 36 | And I should see "Address can't be blank" |
37 | 37 | ||
38 | -@kalibro_restart | 38 | +@kalibro_restart @javascript @wip |
39 | Scenario: repository creation with name already taken | 39 | Scenario: repository creation with name already taken |
40 | Given I am a regular user | 40 | Given I am a regular user |
41 | And I am signed in | 41 | And I am signed in |
@@ -49,6 +49,6 @@ Scenario: repository creation with name already taken | @@ -49,6 +49,6 @@ Scenario: repository creation with name already taken | ||
49 | And I set the select field "Type" as "GIT" | 49 | And I set the select field "Type" as "GIT" |
50 | And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git" | 50 | And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git" |
51 | And I set the select field "Process Period" as "1 day" | 51 | And I set the select field "Process Period" as "1 day" |
52 | - And I set the select field "repository_configuration_id" as "Java" | 52 | + And I set the select field "Configuration" as "Java" |
53 | When I press the Save button | 53 | When I press the Save button |
54 | Then I should see "There's already" | 54 | Then I should see "There's already" |
55 | \ No newline at end of file | 55 | \ No newline at end of file |
features/step_definitions/project_steps.rb
features/step_definitions/reading_group_steps.rb
features/support/env.rb
@@ -77,11 +77,11 @@ end | @@ -77,11 +77,11 @@ end | ||
77 | # See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature | 77 | # See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature |
78 | Cucumber::Rails::Database.javascript_strategy = :truncation | 78 | Cucumber::Rails::Database.javascript_strategy = :truncation |
79 | 79 | ||
80 | -# Kalibro hooks | ||
81 | -require 'kalibro_gem/kalibro_cucumber_helpers/hooks' | 80 | +# KalibroGatekeeper hooks |
81 | +require 'kalibro_gatekeeper_client/kalibro_cucumber_helpers/hooks.rb' | ||
82 | 82 | ||
83 | # Configuring the right hooks | 83 | # Configuring the right hooks |
84 | -KalibroGem::KalibroCucumberHelpers.configure_from_yml("#{__dir__}/kalibro_cucumber_helpers.yml") | 84 | +KalibroGatekeeperClient::KalibroCucumberHelpers.configure_from_yml("#{__dir__}/kalibro_cucumber_helpers.yml") |
85 | 85 | ||
86 | # Warden test helpers so the user authentication can be as fast as possible | 86 | # Warden test helpers so the user authentication can be as fast as possible |
87 | include Warden::Test::Helpers | 87 | include Warden::Test::Helpers |
spec/controllers/metric_configurations_controller_spec.rb
@@ -11,7 +11,7 @@ describe MetricConfigurationsController do | @@ -11,7 +11,7 @@ describe MetricConfigurationsController do | ||
11 | context 'when adding new metrics' do | 11 | context 'when adding new metrics' do |
12 | before :each do | 12 | before :each do |
13 | subject.expects(:mezuro_configuration_owner?).returns true | 13 | subject.expects(:mezuro_configuration_owner?).returns true |
14 | - KalibroGem::Entities::BaseTool.expects(:all).returns([base_tool]) | 14 | + KalibroGatekeeperClient::Entities::BaseTool.expects(:all).returns([base_tool]) |
15 | get :choose_metric, mezuro_configuration_id: mezuro_configuration.id | 15 | get :choose_metric, mezuro_configuration_id: mezuro_configuration.id |
16 | end | 16 | end |
17 | 17 | ||
@@ -29,7 +29,7 @@ describe MetricConfigurationsController do | @@ -29,7 +29,7 @@ describe MetricConfigurationsController do | ||
29 | context 'when the current user owns the mezuro configuration' do | 29 | context 'when the current user owns the mezuro configuration' do |
30 | before :each do | 30 | before :each do |
31 | subject.expects(:mezuro_configuration_owner?).returns true | 31 | subject.expects(:mezuro_configuration_owner?).returns true |
32 | - KalibroGem::Entities::BaseTool.expects(:find_by_name).with(base_tool.name).returns(base_tool) | 32 | + KalibroGatekeeperClient::Entities::BaseTool.expects(:find_by_name).with(base_tool.name).returns(base_tool) |
33 | post :new, mezuro_configuration_id: mezuro_configuration.id, metric_name: "Lines of Code", base_tool_name: base_tool.name | 33 | post :new, mezuro_configuration_id: mezuro_configuration.id, metric_name: "Lines of Code", base_tool_name: base_tool.name |
34 | end | 34 | end |
35 | 35 | ||
@@ -64,7 +64,7 @@ describe MetricConfigurationsController do | @@ -64,7 +64,7 @@ describe MetricConfigurationsController do | ||
64 | context 'with valid fields' do | 64 | context 'with valid fields' do |
65 | before :each do | 65 | before :each do |
66 | MetricConfiguration.any_instance.expects(:save).returns(true) | 66 | MetricConfiguration.any_instance.expects(:save).returns(true) |
67 | - KalibroGem::Entities::BaseTool.expects(:find_by_name).with(base_tool.name).returns(base_tool) | 67 | + KalibroGatekeeperClient::Entities::BaseTool.expects(:find_by_name).with(base_tool.name).returns(base_tool) |
68 | 68 | ||
69 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name | 69 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name |
70 | end | 70 | end |
@@ -75,7 +75,7 @@ describe MetricConfigurationsController do | @@ -75,7 +75,7 @@ describe MetricConfigurationsController do | ||
75 | context 'with invalid fields' do | 75 | context 'with invalid fields' do |
76 | before :each do | 76 | before :each do |
77 | MetricConfiguration.any_instance.expects(:save).returns(false) | 77 | MetricConfiguration.any_instance.expects(:save).returns(false) |
78 | - KalibroGem::Entities::BaseTool.expects(:find_by_name).with(base_tool.name).returns(base_tool) | 78 | + KalibroGatekeeperClient::Entities::BaseTool.expects(:find_by_name).with(base_tool.name).returns(base_tool) |
79 | 79 | ||
80 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name | 80 | post :create, mezuro_configuration_id: mezuro_configuration.id, metric_configuration: metric_configuration_params, base_tool_name: base_tool.name |
81 | end | 81 | end |
spec/factories/base_tools.rb
1 | FactoryGirl.define do | 1 | FactoryGirl.define do |
2 | - factory :base_tool, class: KalibroGem::Entities::BaseTool do | 2 | + factory :base_tool, class: KalibroGatekeeperClient::Entities::BaseTool do |
3 | name 'Analizo' | 3 | name 'Analizo' |
4 | supported_metric {FactoryGirl.build(:loc)} | 4 | supported_metric {FactoryGirl.build(:loc)} |
5 | end | 5 | end |
spec/factories/metric_configurations_snapshot.rb
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | FactoryGirl.define do | 17 | FactoryGirl.define do |
18 | - factory :metric_configuration_snapshot, class: KalibroGem::Entities::MetricConfigurationSnapshot do | 18 | + factory :metric_configuration_snapshot, class: KalibroGatekeeperClient::Entities::MetricConfigurationSnapshot do |
19 | code "code" | 19 | code "code" |
20 | weight "1.0" | 20 | weight "1.0" |
21 | aggregation_form 'AVERAGE' | 21 | aggregation_form 'AVERAGE' |
spec/factories/metric_results.rb
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | FactoryGirl.define do | 17 | FactoryGirl.define do |
18 | - factory :metric_result, class: KalibroGem::Entities::MetricResult do | 18 | + factory :metric_result, class: KalibroGatekeeperClient::Entities::MetricResult do |
19 | id "42" | 19 | id "42" |
20 | self.configuration { FactoryGirl.build(:metric_configuration_snapshot) } | 20 | self.configuration { FactoryGirl.build(:metric_configuration_snapshot) } |
21 | value "10.0" | 21 | value "10.0" |
spec/factories/metrics.rb
1 | FactoryGirl.define do | 1 | FactoryGirl.define do |
2 | - factory :metric, class: KalibroGem::Entities::Metric do | 2 | + factory :metric, class: KalibroGatekeeperClient::Entities::Metric do |
3 | name "Total Abstract Classes" | 3 | name "Total Abstract Classes" |
4 | compound false | 4 | compound false |
5 | scope "SOFTWARE" | 5 | scope "SOFTWARE" |
@@ -8,7 +8,7 @@ FactoryGirl.define do | @@ -8,7 +8,7 @@ FactoryGirl.define do | ||
8 | language ["C", "CPP", "JAVA"] | 8 | language ["C", "CPP", "JAVA"] |
9 | end | 9 | end |
10 | 10 | ||
11 | - factory :loc, class: KalibroGem::Entities::Metric do | 11 | + factory :loc, class: KalibroGatekeeperClient::Entities::Metric do |
12 | name "Lines of Code" | 12 | name "Lines of Code" |
13 | compound false | 13 | compound false |
14 | scope "CLASS" | 14 | scope "CLASS" |
@@ -17,7 +17,7 @@ FactoryGirl.define do | @@ -17,7 +17,7 @@ FactoryGirl.define do | ||
17 | language ["C", "CPP", "JAVA"] | 17 | language ["C", "CPP", "JAVA"] |
18 | end | 18 | end |
19 | 19 | ||
20 | - factory :compound_metric, class: KalibroGem::Entities::Metric do | 20 | + factory :compound_metric, class: KalibroGatekeeperClient::Entities::Metric do |
21 | name "Compound" | 21 | name "Compound" |
22 | compound true | 22 | compound true |
23 | scope "CLASS" | 23 | scope "CLASS" |
spec/factories/modules.rb
spec/factories/process_times.rb
1 | FactoryGirl.define do | 1 | FactoryGirl.define do |
2 | - factory :process_time, class: KalibroGem::Entities::ProcessTime do | 2 | + factory :process_time, class: KalibroGatekeeperClient::Entities::ProcessTime do |
3 | state "Ready" | 3 | state "Ready" |
4 | time "3600" | 4 | time "3600" |
5 | end | 5 | end |
6 | 6 | ||
7 | - factory :analyzing_process_time, class: KalibroGem::Entities::ProcessTime do | 7 | + factory :analyzing_process_time, class: KalibroGatekeeperClient::Entities::ProcessTime do |
8 | state "Analyzing" | 8 | state "Analyzing" |
9 | time "12345" | 9 | time "12345" |
10 | end | 10 | end |
spec/factories/ranges_snapshot.rb
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | FactoryGirl.define do | 17 | FactoryGirl.define do |
18 | - factory :range_snapshot, class: KalibroGem::Entities::RangeSnapshot do | 18 | + factory :range_snapshot, class: KalibroGatekeeperClient::Entities::RangeSnapshot do |
19 | beginning 1.1 | 19 | beginning 1.1 |
20 | self.end 5.1 | 20 | self.end 5.1 |
21 | label "Snapshot" | 21 | label "Snapshot" |
spec/models/module_result_spec.rb
@@ -6,7 +6,7 @@ describe ModuleResult do | @@ -6,7 +6,7 @@ describe ModuleResult do | ||
6 | 6 | ||
7 | describe 'metric_results' do | 7 | describe 'metric_results' do |
8 | it 'should call the metric_results_of method' do | 8 | it 'should call the metric_results_of method' do |
9 | - KalibroGem::Entities::MetricResult.expects(:metric_results_of).with(subject.id).returns(nil) | 9 | + KalibroGatekeeperClient::Entities::MetricResult.expects(:metric_results_of).with(subject.id).returns(nil) |
10 | 10 | ||
11 | subject.metric_results | 11 | subject.metric_results |
12 | end | 12 | end |