mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fix failing specs related to requiring distributor for payment method
This commit is contained in:
@@ -113,7 +113,7 @@ feature %q{
|
||||
e2 = create(:enterprise)
|
||||
eg1 = create(:enterprise_group, name: 'eg1')
|
||||
eg2 = create(:enterprise_group, name: 'eg2')
|
||||
payment_method = create(:payment_method, distributors: [])
|
||||
payment_method = create(:payment_method, distributors: [e2])
|
||||
shipping_method = create(:shipping_method, distributors: [e2])
|
||||
enterprise_fee = create(:enterprise_fee, enterprise: @enterprise )
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ feature %q{
|
||||
|
||||
fill_in 'payment_method_name', :with => 'Cheque payment method'
|
||||
|
||||
select @distributors[0].name, :from => 'payment_method_distributor_ids', visible: false
|
||||
check "payment_method_distributor_ids_#{@distributors[0].id}"
|
||||
click_button 'Create'
|
||||
|
||||
flash_message.should == 'Payment Method has been successfully created!'
|
||||
|
||||
@@ -22,9 +22,11 @@ describe Spree::Order do
|
||||
end
|
||||
|
||||
describe "Payment methods" do
|
||||
let(:order) { build(:order, distributor: create(:distributor_enterprise)) }
|
||||
let(:pm1) { create(:payment_method, distributors: [order.distributor])}
|
||||
let(:pm2) { create(:payment_method, distributors: [])}
|
||||
let(:order_distributor) { create(:distributor_enterprise) }
|
||||
let(:some_other_distributor) { create(:distributor_enterprise) }
|
||||
let(:order) { build(:order, distributor: order_distributor) }
|
||||
let(:pm1) { create(:payment_method, distributors: [order_distributor])}
|
||||
let(:pm2) { create(:payment_method, distributors: [some_other_distributor])}
|
||||
|
||||
it "finds the correct payment methods" do
|
||||
Spree::PaymentMethod.stub(:available).and_return [pm1, pm2]
|
||||
|
||||
Reference in New Issue
Block a user