From 7b30008e8b0346a62a30e6a2ea94589c3eff8dd5 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Mon, 6 Jul 2020 15:34:51 +0100 Subject: [PATCH] Run transpec --- spec/lib/spree/money_spec.rb | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/spec/lib/spree/money_spec.rb b/spec/lib/spree/money_spec.rb index f4fb0948d3..139806137c 100644 --- a/spec/lib/spree/money_spec.rb +++ b/spec/lib/spree/money_spec.rb @@ -13,24 +13,24 @@ describe Spree::Money do it "formats correctly" do money = Spree::Money.new(10) - money.to_s.should == "$10.00" + expect(money.to_s).to eq("$10.00") end it "can get cents" do money = Spree::Money.new(10) - money.cents.should == 1000 + expect(money.cents).to eq(1000) end context "with currency" do it "passed in option" do money = Spree::Money.new(10, with_currency: true, html: false) - money.to_s.should == "$10.00 USD" + expect(money.to_s).to eq("$10.00 USD") end it "config option" do Spree::Config[:display_currency] = true money = Spree::Money.new(10, html: false) - money.to_s.should == "$10.00 USD" + expect(money.to_s).to eq("$10.00 USD") end end @@ -38,13 +38,13 @@ describe Spree::Money do it "hides cents suffix" do Spree::Config[:hide_cents] = true money = Spree::Money.new(10) - money.to_s.should == "$10" + expect(money.to_s).to eq("$10") end it "shows cents suffix" do Spree::Config[:hide_cents] = false money = Spree::Money.new(10) - money.to_s.should == "$10.00" + expect(money.to_s).to eq("$10.00") end end @@ -52,14 +52,14 @@ describe Spree::Money do context "when currency is specified in Canadian Dollars" do it "uses the currency param over the global configuration" do money = Spree::Money.new(10, currency: 'CAD', with_currency: true, html: false) - money.to_s.should == "$10.00 CAD" + expect(money.to_s).to eq("$10.00 CAD") end end context "when currency is specified in Japanese Yen" do it "uses the currency param over the global configuration" do money = Spree::Money.new(100, currency: 'JPY', html: false) - money.to_s.should == "¥100" + expect(money.to_s).to eq("¥100") end end end @@ -67,18 +67,18 @@ describe Spree::Money do context "symbol positioning" do it "passed in option" do money = Spree::Money.new(10, symbol_position: :after, html: false) - money.to_s.should == "10.00 $" + expect(money.to_s).to eq("10.00 $") end it "passed in option string" do money = Spree::Money.new(10, symbol_position: "after", html: false) - money.to_s.should == "10.00 $" + expect(money.to_s).to eq("10.00 $") end it "config option" do Spree::Config[:currency_symbol_position] = :after money = Spree::Money.new(10, html: false) - money.to_s.should == "10.00 $" + expect(money.to_s).to eq("10.00 $") end end @@ -93,7 +93,7 @@ describe Spree::Money do it "formats correctly" do money = Spree::Money.new(1000, html: false) - money.to_s.should == "¥1,000" + expect(money.to_s).to eq("¥1,000") end end @@ -106,30 +106,30 @@ describe Spree::Money do end end - # Regression test for #2634 + # Regression test for Spree #2634 it "formats as plain by default" do money = Spree::Money.new(10) - money.to_s.should == "10.00 €" + expect(money.to_s).to eq("10.00 €") end - # Regression test for #2632 + # Regression test for Spree #2632 it "acknowledges decimal mark option" do Spree::Config[:currency_decimal_mark] = "," money = Spree::Money.new(10) - money.to_s.should == "10,00 €" + expect(money.to_s).to eq("10,00 €") end - # Regression test for #2632 + # Regression test for Spree #2632 it "acknowledges thousands separator option" do Spree::Config[:currency_thousands_separator] = "." money = Spree::Money.new(1000) - money.to_s.should == "1.000.00 €" + expect(money.to_s).to eq("1.000.00 €") end it "formats as HTML if asked (nicely) to" do money = Spree::Money.new(10) # The HTMLified version of the euro sign - money.to_html.should == "10.00 €" + expect(money.to_html).to eq("10.00 €") end end end