Skip to content

Commit

Permalink
Don't list chargeback rate for metering reports
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Feb 1, 2018
1 parent eb013c1 commit b524ccb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/metering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Metering
extend ActiveSupport::Concern

included do
DISALLOWED_SUFFIXES = %w(_cost).freeze
DISALLOWED_SUFFIXES = %w(_cost chargeback_rates).freeze

def self.attribute_names
super.reject { |x| x.ends_with?(*DISALLOWED_SUFFIXES) }
Expand Down
34 changes: 34 additions & 0 deletions spec/models/metering_vm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,38 @@
end
end
end

let(:allowed_attributes) do
%w(start_date
end_date
interval_name
display_range
entity
tag_name
label_name
fixed_compute_metric
id
vm_id
vm_name
vm_uid
vm_guid
owner_name
provider_name
provider_uid
cpu_allocated_metric
cpu_used_metric
disk_io_used_metric
memory_allocated_metric
memory_used_metric
net_io_used_metric
storage_allocated_metric
storage_used_metric
metering_used_metric
existence_hours_metric
)
end

it 'lists proper attributes' do
expect(described_class.attribute_names).to match_array(allowed_attributes)
end
end

0 comments on commit b524ccb

Please sign in to comment.