mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
Run transpec
This commit is contained in:
@@ -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 = ""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user