Skip to content

Commit

Permalink
Fix payment method controllers by removing unnecessary param that onl…
Browse files Browse the repository at this point in the history
…y exists in stripe connect payment method preferred_enterprise_id
  • Loading branch information
luisramos0 committed Feb 25, 2020
1 parent 316aa2c commit af12f63
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GatewayWithPassword < PaymentMethod
describe Admin::PaymentMethodsController, type: :controller do
describe "#create and #update" do
let!(:enterprise) { create(:distributor_enterprise, owner: user) }
let(:payment_method) { GatewayWithPassword.create!(name: "Bogus", preferred_password: "haxme", distributor_ids: [enterprise.id], preferred_enterprise_id: enterprise.id) }
let(:payment_method) { GatewayWithPassword.create!(name: "Bogus", preferred_password: "haxme", distributor_ids: [enterprise.id]) }
let!(:user) { create(:user) }

before { allow(controller).to receive(:spree_current_user) { user } }
Expand All @@ -33,7 +33,7 @@ class GatewayWithPassword < PaymentMethod

it "can create a payment method of a valid type" do
expect {
spree_post :create, payment_method: { name: "Test Method", type: "Spree::Gateway::Bogus", distributor_ids: [enterprise.id], preferred_enterprise_id: enterprise.id }
spree_post :create, payment_method: { name: "Test Method", type: "Spree::Gateway::Bogus", distributor_ids: [enterprise.id] }
}.to change(Spree::PaymentMethod, :count).by(1)

expect(response).to be_redirect
Expand All @@ -42,7 +42,7 @@ class GatewayWithPassword < PaymentMethod

it "can not create a payment method of an invalid type" do
expect {
spree_post :create, payment_method: { name: "Invalid Payment Method", type: "Spree::InvalidType", distributor_ids: [enterprise.id], preferred_enterprise_id: enterprise.id }
spree_post :create, payment_method: { name: "Invalid Payment Method", type: "Spree::InvalidType", distributor_ids: [enterprise.id] }
}.to change(Spree::PaymentMethod, :count).by(0)

expect(response).to be_redirect
Expand Down

0 comments on commit af12f63

Please sign in to comment.