Commit 2dae71777a22da830650b1d260ae38c2d3468880
Committed by
Rafael Manzo
1 parent
73b93dec
Exists in
colab
and in
4 other branches
Encapsulating kalibro gem Mezuro Range method
signed-off-by: Diego Araújo <diegoamc90@gmail.com>
Showing
2 changed files
with
18 additions
and
1 deletions
Show diff stats
app/models/metric_configuration.rb
spec/models/metric_configuration_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | 3 | describe MetricConfiguration do |
4 | + subject {FactoryGirl.build(:metric_configuration)} | |
5 | + | |
6 | + describe 'methods' do | |
7 | + describe 'mezuro_ranges' do | |
8 | + let(:mezuro_range) { FactoryGirl.build(:mezuro_range) } | |
9 | + before :each do | |
10 | + MezuroRange.expects(:ranges_of).with(subject.id).returns([mezuro_range]) | |
11 | + end | |
12 | + | |
13 | + it 'should returns a list with its ranges' do | |
14 | + subject.mezuro_ranges.should eq([mezuro_range]) | |
15 | + end | |
16 | + end | |
17 | + end | |
18 | + | |
4 | 19 | describe 'validations' do |
5 | - subject {FactoryGirl.build(:metric_configuration)} | |
6 | 20 | |
7 | 21 | context 'active model validations' do |
8 | 22 | before :each do | ... | ... |