mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
add view spec to replace feature spec
This commit is contained in:
@@ -185,16 +185,6 @@ feature '
|
||||
expect(page).not_to have_content payment_method3.name
|
||||
end
|
||||
|
||||
it "shows only the providers of the existing payment methods" do
|
||||
payment_method1
|
||||
payment_method2
|
||||
payment_method3
|
||||
|
||||
visit spree.admin_payment_methods_path
|
||||
|
||||
expect(page).to have_content "Cash/EFT/etc. (payments for which automatic validation is not required)", count: 2
|
||||
end
|
||||
|
||||
it "does not show duplicates of payment methods" do
|
||||
payment_method1
|
||||
payment_method2
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user