Skip to content

Commit

Permalink
Add failing spec for inactive payment methods
Browse files Browse the repository at this point in the history
I noticed that inactive payment methods were not being filtered out on
the frontend. This used to happen in `Spree::PaymentMethod.available`,
but in solidusio#1540 this filter was lost.
  • Loading branch information
Luuk Veenis authored and John Hawthorn committed Apr 10, 2017
1 parent 70a756c commit 0296ebd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/spec/models/spree/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,16 @@ def merge!(other_order, user = nil)
expect(order.available_payment_methods).to include(payment_method)
end

it "does not include inactive payment methods", :pending do
Spree::PaymentMethod.create!({
name: "Fake",
active: false,
available_to_users: true,
available_to_admin: true
})
expect(order.available_payment_methods.count).to eq(0)
end

context "with more than one payment method" do
subject { order.available_payment_methods }

Expand Down

0 comments on commit 0296ebd

Please sign in to comment.