From 78eb5d23f9357793059c2fcfb782ad00cd517fd2 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 9 Feb 2021 11:56:00 +0000 Subject: [PATCH] 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. --- spec/controllers/spree/admin/tax_rates_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/spree/admin/tax_rates_controller_spec.rb b/spec/controllers/spree/admin/tax_rates_controller_spec.rb index 266edc9430..8bef1f2fb1 100644 --- a/spec/controllers/spree/admin/tax_rates_controller_spec.rb +++ b/spec/controllers/spree/admin/tax_rates_controller_spec.rb @@ -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