diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 4d277972e5..6ec19098fe 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -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 ) diff --git a/spec/features/admin/payment_method_spec.rb b/spec/features/admin/payment_method_spec.rb index a5e8cbccec..9f9a0e43a8 100644 --- a/spec/features/admin/payment_method_spec.rb +++ b/spec/features/admin/payment_method_spec.rb @@ -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!' diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index 085ee615c6..63c315a18a 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -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]