Skip to content

Commit

Permalink
Specs: should charge after the given time passed
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed Jan 5, 2017
1 parent 4609f3c commit 73c99b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions spec/models/chargeback_container_image_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe ChargebackContainerImage do
let(:base_options) { {:interval_size => 1, :end_interval_offset => 0, :ext_options => {:tz => 'UTC'} } }
let(:base_options) { {:interval_size => 2, :end_interval_offset => 0, :ext_options => {:tz => 'UTC'} } }
let(:hourly_rate) { 0.01 }
let(:starting_date) { Time.parse('2012-09-01 23:59:59Z').utc }
let(:ts) { starting_date.in_time_zone(Metric::Helper.get_time_zone(options[:ext_options])) }
let(:report_run_time) { starting_date }
let(:report_run_time) { month_end }
let(:month_beginning) { ts.beginning_of_month.utc }
let(:month_end) { ts.end_of_month.utc }
let(:hours_in_month) { Time.days_in_month(month_beginning.month, month_beginning.year) * 24 }
Expand Down
4 changes: 2 additions & 2 deletions spec/models/chargeback_container_project_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
describe ChargebackContainerProject do
include Spec::Support::ChargebackHelper

let(:base_options) { {:interval_size => 1, :end_interval_offset => 0, :ext_options => {:tz => 'UTC'} } }
let(:base_options) { {:interval_size => 2, :end_interval_offset => 0, :ext_options => {:tz => 'UTC'} } }
let(:hourly_rate) { 0.01 }
let(:starting_date) { Time.parse('2012-09-01 23:59:59Z').utc }
let(:ts) { starting_date.in_time_zone(Metric::Helper.get_time_zone(options[:ext_options])) }
let(:report_run_time) { starting_date }
let(:report_run_time) { month_end }
let(:month_beginning) { ts.beginning_of_month.utc }
let(:month_end) { ts.end_of_month.utc }
let(:hours_in_month) { Time.days_in_month(month_beginning.month, month_beginning.year) * 24 }
Expand Down
6 changes: 3 additions & 3 deletions spec/models/chargeback_vm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

let(:admin) { FactoryGirl.create(:user_admin) }
let(:base_options) do
{:interval_size => 1,
{:interval_size => 2,
:end_interval_offset => 0,
:tag => '/managed/environment/prod',
:ext_options => {:tz => 'UTC'},
Expand All @@ -15,8 +15,8 @@
let(:memory_available) { 1000.0 }
let(:vm_allocated_disk_storage) { 4.0 }
let(:starting_date) { Time.parse('2012-09-01 23:59:59Z').utc }
let(:ts) { starting_date.in_time_zone(Metric::Helper.get_time_zone(options[:ext_options])) }
let(:report_run_time) { starting_date }
let(:ts) { starting_date.in_time_zone(Metric::Helper.get_time_zone(base_options[:ext_options])) }
let(:report_run_time) { month_end }
let(:month_beginning) { ts.beginning_of_month.utc }
let(:month_end) { ts.end_of_month.utc }
let(:hours_in_month) { Time.days_in_month(month_beginning.month, month_beginning.year) * 24 }
Expand Down

0 comments on commit 73c99b9

Please sign in to comment.