mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update TaxRatesController spec
BigDecimal was throwing an error here (in Rails 5) unless it received a string, but I think this is actually an issue with the way params were being passed in the relevant spec, as opposed to the controller itself.
This commit is contained in:
@@ -20,7 +20,7 @@ module Spree
|
||||
context "when the amount is not changed" do
|
||||
it "updates the record" do
|
||||
expect {
|
||||
spree_put :update, id: tax_rate.id, tax_rate: { name: "Updated Rate", amount: 0.1 }
|
||||
spree_put :update, id: tax_rate.id, tax_rate: { name: "Updated Rate", amount: "0.1" }
|
||||
}.to_not change{ Spree::TaxRate.with_deleted.count }
|
||||
|
||||
expect(response).to redirect_to spree.admin_tax_rates_url
|
||||
@@ -32,7 +32,7 @@ module Spree
|
||||
context "when the amount is changed" do
|
||||
it "duplicates the record and soft-deletes the duplicate" do
|
||||
expect {
|
||||
spree_put :update, id: tax_rate.id, tax_rate: { name: "Changed Rate", amount: 0.5 }
|
||||
spree_put :update, id: tax_rate.id, tax_rate: { name: "Changed Rate", amount: "0.5" }
|
||||
}.to change{ Spree::TaxRate.with_deleted.count }.by(1)
|
||||
|
||||
expect(response).to redirect_to spree.admin_tax_rates_url
|
||||
|
||||
Reference in New Issue
Block a user