Skip to content

Commit

Permalink
added test coverage for TenanatQuota.format_quota_value
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Oct 18, 2019
1 parent f47bd58 commit 7a976ba
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/models/tenant_quota_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,19 @@
end
end

describe ".format_quota_value" do
let(:quota_name) { "cpu_allocated" }
let(:quota_description) { "Allocated Virtual CPUs" }

it "returns quota description if field to format is 'tenant_quotas.name'" do
expect(described_class.format_quota_value("tenant_quotas.name", "something", quota_name )).to eq(quota_description)
end

it "returns quota description if field to format is 'tenant_quotas.description'" do
expect(described_class.format_quota_value("tenant_quotas.description", "something", quota_name )).to eq(quota_description)
end
end

describe "#quota_hash" do
it "has cpu_allocated attributes" do
expect(described_class.new(:tenant => tenant, :name => "cpu_allocated", :value => 4096).tap(&:valid?).quota_hash).to eq(
Expand Down

0 comments on commit 7a976ba

Please sign in to comment.