Removed checkout only from DISPLAY options on payment method edit form and updated payment_method_spec

This commit is contained in:
Nihal Mohammed
2022-02-21 22:50:21 +05:30
parent b0fd333126
commit 3820d4c591
2 changed files with 3 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ module Spree
acts_as_taggable
acts_as_paranoid
DISPLAY = [:both, :front_end, :back_end].freeze
DISPLAY = [:both, :back_end].freeze
default_scope -> { where(deleted_at: nil) }
has_many :credit_cards, class_name: "Spree::CreditCard"

View File

@@ -13,7 +13,7 @@ module Spree
before do
Spree::PaymentMethod.delete_all
[nil, 'both', 'front_end', 'back_end'].each do |display_on|
[nil, 'both', 'back_end'].each do |display_on|
Spree::Gateway::Test.create(
name: 'Display Both',
display_on: display_on,
@@ -23,7 +23,7 @@ module Spree
distributors: [enterprise]
)
end
expect(Spree::PaymentMethod.all.size).to eq 4
expect(Spree::PaymentMethod.all.size).to eq 3
end
it "should return all methods available to front-end/back-end when no parameter is passed" do
@@ -34,10 +34,6 @@ module Spree
expect(Spree::PaymentMethod.available(:both).size).to eq 2
end
it "should return all methods available to front-end when display_on = :front_end" do
expect(Spree::PaymentMethod.available(:front_end).size).to eq 2
end
it "should return all methods available to back-end when display_on = :back_end" do
expect(Spree::PaymentMethod.available(:back_end).size).to eq 2
end