Skip to content

Commit

Permalink
Add spec test for Default Container Image Rate
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilda Stastna committed Jan 10, 2018
1 parent ad0476e commit 65ddd88
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/models/chargeback_rate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
expect(cbr.errors.first).to include("default rate cannot be deleted")
end

it "when non-default with default description" do
cbr = FactoryGirl.create(:chargeback_rate, :description => "Default Container Image Rate", :default => false)
cbr.destroy
expect(cbr).to_not be_destroyed
expect(cbr.errors.count).to be(1)
expect(cbr.errors.first).to include("default rate cannot be deleted")
end

it "when non-default" do
cbr = FactoryGirl.create(:chargeback_rate, :description => "Non-default", :default => false)
cbr.destroy
Expand Down

0 comments on commit 65ddd88

Please sign in to comment.