Run transpec

This commit is contained in:
Luis Ramos
2020-08-07 12:45:55 +01:00
parent ff8735d7a4
commit 02f50774bb
3 changed files with 8 additions and 8 deletions

View File

@@ -77,7 +77,7 @@ describe Spree::Address do
end
it "full state name is in state_name and country does contain that state" do
country.states.stub find_all_by_name_or_abbr: [create(:state, name: 'alabama', abbr: 'al')]
allow(country.states).to receive_messages find_all_by_name_or_abbr: [create(:state, name: 'alabama', abbr: 'al')]
address.update state_name: 'alabama'
expect(address).to be_valid
expect(address.state.name).to eq 'alabama'
@@ -85,7 +85,7 @@ describe Spree::Address do
end
it "state abbr is in state_name and country does contain that state" do
country.states.stub find_all_by_name_or_abbr: [state]
allow(country.states).to receive_messages find_all_by_name_or_abbr: [state]
address.state_name = state.abbr
expect(address).to be_valid
expect(address.state.abbr).to eq state.abbr
@@ -93,7 +93,7 @@ describe Spree::Address do
end
it "both state and state_name are entered and country does contain the state" do
country.states.stub find_all_by_name_or_abbr: [state]
allow(country.states).to receive_messages find_all_by_name_or_abbr: [state]
address.state = state
address.state_name = 'maryland'
expect(address).to be_valid
@@ -120,7 +120,7 @@ describe Spree::Address do
end
context "phone not required" do
before { address.instance_eval{ stub require_phone?: false } }
before { address.instance_eval{ double require_phone?: false } }
it "shows no errors when phone is blank" do
address.phone = ""
@@ -130,7 +130,7 @@ describe Spree::Address do
end
context "zipcode not required" do
before { address.instance_eval{ stub require_zipcode?: false } }
before { address.instance_eval{ double require_zipcode?: false } }
it "shows no errors when phone is blank" do
address.zipcode = ""

View File

@@ -144,7 +144,7 @@ module Spree
let(:shipping_method){ create :shipping_method }
it "should set calculable correctly" do
shipping_method.calculator.calculable.should == shipping_method
expect(shipping_method.calculator.calculable).to eq(shipping_method)
end
end
end

View File

@@ -10,7 +10,7 @@ describe Spree::ShippingRate do
shipping_method: shipping_method,
cost: 10.55)
}
before { Spree::TaxRate.stub(default: 0.05) }
before { allow(Spree::TaxRate).to receive_messages(default: 0.05) }
context "#display_price" do
context "when shipment includes VAT" do
@@ -30,7 +30,7 @@ describe Spree::ShippingRate do
context "when the currency is JPY" do
let(:shipping_rate) {
shipping_rate = Spree::ShippingRate.new(cost: 205)
shipping_rate.stub(currency: "JPY")
allow(shipping_rate).to receive_messages(currency: "JPY")
shipping_rate
}