processing_spec.rb
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'spec_helper'
describe Processing do
describe 'methods' do
subject { FactoryGirl.build(:processing) }
describe 'ready?' do
context 'with a READY processing' do
it 'should return true' do
subject.ready?.should be_true
end
end
context 'without a READY processing' do
subject { FactoryGirl.build(:processing, state: 'COLLECTING') }
it 'should return false' do
subject.ready?.should be_false
end
end
end
describe 'metric_results' do
it 'should call the metric_results_of method' do
KalibroEntities::Entities::MetricResult.expects(:metric_results_of).with(subject.results_root_id).returns(nil)
subject.metric_results
end
end
describe 'root_module_result' do
it 'should call the root_module_result method' do
KalibroEntities::Entities::ModuleResult.expects(:find).with(subject.results_root_id).returns(FactoryGirl.build(:module_result))
subject.root_module_result
end
end
end
end