Skip to content

Commit

Permalink
fix spec for ConsumptionWithRollups
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Jun 14, 2018
1 parent 4875cb3 commit 541dfe7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/models/chargeback/consumption_with_rollups_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe Chargeback::ConsumptionWithRollups do
let(:vm) { FactoryGirl.build(:vm_microsoft) }
let(:consumption) { described_class.new([metric_rollup], starting_date, starting_date + 1.day) }
let(:vm) { FactoryGirl.create(:vm_microsoft) }
let(:consumption) { described_class.new(pluck_rollup([metric_rollup]), starting_date, starting_date + 1.day) }

describe '#sub_metric_rollups' do
let(:starting_date) { Time.parse('2012-09-01 23:59:59Z').utc }
Expand All @@ -9,6 +9,10 @@
let!(:state) { FactoryGirl.create(:vim_performance_state, :resource => vm, :state_data => nil, :timestamp => starting_date, :capture_interval => 3_600) }
let!(:metric_rollup) { FactoryGirl.create(:metric_rollup_vm_hr, :timestamp => starting_date + 1.hour, :resource => vm) }

def pluck_rollup(metric_rollup_records)
metric_rollup_records.pluck(*ChargeableField.cols_on_metric_rollup)
end

before do
Timecop.travel(starting_date + 10.hours)
end
Expand Down

0 comments on commit 541dfe7

Please sign in to comment.