Commit 610185864fa1b019f1e5b8d9db0eacd4ab1540fb
Committed by
Rafael Manzo
1 parent
18794d7f
Exists in
colab
and in
4 other branches
Fixed unit tests
Signed off by: Diego Araújo <diegoamc90@gmail.com> Signed off by: Daniel Paulino Alves <danpaulalves@gmail.com>
Showing
4 changed files
with
7 additions
and
10 deletions
Show diff stats
Gemfile.lock
1 | 1 | GIT |
2 | 2 | remote: https://github.com/mezuro/kalibro_client |
3 | - revision: 190e8b25819846b52eb1faff07f20f3a3ecad4c9 | |
3 | + revision: c87d4e5b55f768ba4e59f964ac9d8dcea94216d6 | |
4 | 4 | specs: |
5 | - kalibro_client (1.0.0) | |
5 | + kalibro_client (0.0.1) | |
6 | 6 | activesupport (>= 2.2.1) |
7 | 7 | faraday_middleware (~> 0.9.0) |
8 | 8 | ... | ... |
spec/helpers/processings_helper_spec.rb
... | ... | @@ -21,7 +21,7 @@ describe ProcessingsHelper, :type => :helper do |
21 | 21 | let(:range_snapshot_10dot1_to_15) { FactoryGirl.build(:range_snapshot, {beginning: 10.1, end: 15.0}) } |
22 | 22 | |
23 | 23 | before :each do |
24 | - metric_result.expects(:metric_configuration).returns(metric_result.metric_configuration) | |
24 | + metric_result.expects(:metric_configuration).returns(metric_configuration) | |
25 | 25 | metric_configuration.expects(:kalibro_ranges). |
26 | 26 | returns([range_snapshot_1_to_5, |
27 | 27 | range_snapshot_5dot1_to_10, | ... | ... |
spec/models/module_result_spec.rb
... | ... | @@ -6,20 +6,21 @@ describe ModuleResult, :type => :model do |
6 | 6 | |
7 | 7 | describe 'metric_history' do |
8 | 8 | let(:date_module_result) {FactoryGirl.build(:date_module_result)} |
9 | - let!(:metric_result) { FactoryGirl.build(:metric_result, metric_configuration: FactoryGirl.build(:another_metric_configuration)) } | |
9 | + let(:metric_configuration) { FactoryGirl.build(:another_metric_configuration) } | |
10 | + let!(:metric_result) { FactoryGirl.build(:metric_result, metric_configuration: metric_configuration) } | |
10 | 11 | let(:processing) {FactoryGirl.build(:processing)} |
11 | 12 | let(:repository) {FactoryGirl.build(:repository)} |
12 | 13 | |
13 | 14 | before :each do |
14 | 15 | subject.expects(:processing).returns(processing) |
15 | - metric_result.expects(:metric_configuration).returns(metric_result.metric_configuration) | |
16 | + metric_result.expects(:metric_configuration).returns(metric_configuration) | |
16 | 17 | processing.expects(:repository).returns(repository) |
17 | 18 | repository.expects(:module_result_history_of).with(subject).returns([date_module_result]) |
18 | 19 | ModuleResult.any_instance.expects(:metric_results).returns([metric_result]) |
19 | 20 | end |
20 | 21 | |
21 | 22 | it 'should return the history for the given metric name' do |
22 | - expect(subject.metric_history(metric_result.metric_configuration.metric.name)).to eq({date_module_result.date => metric_result.value}) | |
23 | + expect(subject.metric_history(metric_configuration.metric.name)).to eq({date_module_result.date => metric_result.value}) | |
23 | 24 | end |
24 | 25 | end |
25 | 26 | end | ... | ... |
spec/models/reading_group_spec.rb