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 | GIT | 1 | GIT |
2 | remote: https://github.com/mezuro/kalibro_client | 2 | remote: https://github.com/mezuro/kalibro_client |
3 | - revision: 190e8b25819846b52eb1faff07f20f3a3ecad4c9 | 3 | + revision: c87d4e5b55f768ba4e59f964ac9d8dcea94216d6 |
4 | specs: | 4 | specs: |
5 | - kalibro_client (1.0.0) | 5 | + kalibro_client (0.0.1) |
6 | activesupport (>= 2.2.1) | 6 | activesupport (>= 2.2.1) |
7 | faraday_middleware (~> 0.9.0) | 7 | faraday_middleware (~> 0.9.0) |
8 | 8 |
spec/helpers/processings_helper_spec.rb
@@ -21,7 +21,7 @@ describe ProcessingsHelper, :type => :helper do | @@ -21,7 +21,7 @@ describe ProcessingsHelper, :type => :helper do | ||
21 | let(:range_snapshot_10dot1_to_15) { FactoryGirl.build(:range_snapshot, {beginning: 10.1, end: 15.0}) } | 21 | let(:range_snapshot_10dot1_to_15) { FactoryGirl.build(:range_snapshot, {beginning: 10.1, end: 15.0}) } |
22 | 22 | ||
23 | before :each do | 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 | metric_configuration.expects(:kalibro_ranges). | 25 | metric_configuration.expects(:kalibro_ranges). |
26 | returns([range_snapshot_1_to_5, | 26 | returns([range_snapshot_1_to_5, |
27 | range_snapshot_5dot1_to_10, | 27 | range_snapshot_5dot1_to_10, |
spec/models/module_result_spec.rb
@@ -6,20 +6,21 @@ describe ModuleResult, :type => :model do | @@ -6,20 +6,21 @@ describe ModuleResult, :type => :model do | ||
6 | 6 | ||
7 | describe 'metric_history' do | 7 | describe 'metric_history' do |
8 | let(:date_module_result) {FactoryGirl.build(:date_module_result)} | 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 | let(:processing) {FactoryGirl.build(:processing)} | 11 | let(:processing) {FactoryGirl.build(:processing)} |
11 | let(:repository) {FactoryGirl.build(:repository)} | 12 | let(:repository) {FactoryGirl.build(:repository)} |
12 | 13 | ||
13 | before :each do | 14 | before :each do |
14 | subject.expects(:processing).returns(processing) | 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 | processing.expects(:repository).returns(repository) | 17 | processing.expects(:repository).returns(repository) |
17 | repository.expects(:module_result_history_of).with(subject).returns([date_module_result]) | 18 | repository.expects(:module_result_history_of).with(subject).returns([date_module_result]) |
18 | ModuleResult.any_instance.expects(:metric_results).returns([metric_result]) | 19 | ModuleResult.any_instance.expects(:metric_results).returns([metric_result]) |
19 | end | 20 | end |
20 | 21 | ||
21 | it 'should return the history for the given metric name' do | 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 | end | 24 | end |
24 | end | 25 | end |
25 | end | 26 | end |
spec/models/reading_group_spec.rb
@@ -6,10 +6,6 @@ describe ReadingGroup, :type => :model do | @@ -6,10 +6,6 @@ describe ReadingGroup, :type => :model do | ||
6 | before :each do | 6 | before :each do |
7 | @subject = FactoryGirl.build(:reading_group) | 7 | @subject = FactoryGirl.build(:reading_group) |
8 | end | 8 | end |
9 | - | ||
10 | - it 'should return false' do | ||
11 | - expect(@subject.persisted?).to eq(false) | ||
12 | - end | ||
13 | end | 9 | end |
14 | 10 | ||
15 | describe 'update' do | 11 | describe 'update' do |