Merge pull request #5538 from jeduardo824/bug/4592-payment-methods-table-in-dashboard

Fix Payment Methods table to show proper provider name
This commit is contained in:
Luis Ramos
2020-06-25 20:32:04 +01:00
committed by GitHub
2 changed files with 29 additions and 1 deletions

View File

@@ -32,7 +32,7 @@
- method.distributors.each do |distributor|
= distributor.name
%br/
%td= method.type
%td= method.class.clean_name
%td.align-center= method.environment.to_s.titleize
%td.align-center= method.display_on.blank? ? t('.both') : t('.' + method.display_on.to_s)
%td.align-center= method.active ? t('.active_yes') : t('.active_no')

View File

@@ -0,0 +1,28 @@
require "spec_helper"
describe "spree/admin/payment_methods/index.html.haml" do
before do
controller.singleton_class.class_eval do
helper_method :new_object_url, :edit_object_url, :object_url
def new_object_url() "" end
def edit_object_url(object, options = {}) "" end
def object_url(object = nil, options = {}) "" end
end
assign(:payment_methods, [
create(:payment_method),
create(:payment_method)
])
end
describe "payment methods index page" do
it "shows only the providers of the existing payment methods" do
render
expect(rendered).to have_content "Cash/EFT/etc. (payments for which automatic validation is not required)", count: 2
end
end
end