From 7b602ea9fdd622055eea17ae5a824a40e8cf1d8d Mon Sep 17 00:00:00 2001 From: lpichler Date: Thu, 24 Aug 2017 10:44:06 +0200 Subject: [PATCH] Fix spec for multiple rates as we are using one metric_rollup and changing it to get then we need to refresh instance variables of consumption --- spec/models/chargeback_vm_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/models/chargeback_vm_spec.rb b/spec/models/chargeback_vm_spec.rb index b808a15e3af..f175bac7a89 100644 --- a/spec/models/chargeback_vm_spec.rb +++ b/spec/models/chargeback_vm_spec.rb @@ -499,6 +499,8 @@ [rate_assignment_options_1, rate_assignment_options_2].each do |rate_assignment| metric_rollup.tag_names = rate_assignment[:tag].first.tag.send(:name_path) uniq_rates = chargeback_vm.get(consumption) + consumption.instance_variable_set(:@tag_names, nil) + consumption.instance_variable_set(:@hash_features_affecting_rate, nil) expect([rate_assignment[:cb_rate]]).to match_array(uniq_rates) end end