mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-05 02:41:33 +00:00
Do not display links to enterprise payment methods and shipping methods when enterprise is a supplier only
This commit is contained in:
@@ -41,8 +41,10 @@
|
||||
<%= link_to_with_icon('icon-edit', 'Edit Profile', main_app.edit_admin_enterprise_path(enterprise), class: 'edit') %><br />
|
||||
<%= link_to_delete_enterprise enterprise %><br />
|
||||
|
||||
<%= link_to_with_icon 'icon-chevron-right', 'Payment Methods', spree.admin_payment_methods_path(enterprise_id: enterprise.id) %> (<%= enterprise.payment_methods.count %>)<br />
|
||||
<%= link_to_with_icon 'icon-plane', 'Shipping Methods', spree.admin_shipping_methods_path(enterprise_id: enterprise.id) %> (<%= enterprise.shipping_methods.count %>)<br />
|
||||
<% if enterprise.is_distributor %>
|
||||
<%= link_to_with_icon 'icon-chevron-right', 'Payment Methods', spree.admin_payment_methods_path(enterprise_id: enterprise.id) %> (<%= enterprise.payment_methods.count %>)<br />
|
||||
<%= link_to_with_icon 'icon-plane', 'Shipping Methods', spree.admin_shipping_methods_path(enterprise_id: enterprise.id) %> (<%= enterprise.shipping_methods.count %>)<br />
|
||||
<% end %>
|
||||
<%= link_to_with_icon 'icon-money', 'Enterprise Fees', main_app.admin_enterprise_fees_path(enterprise_id: enterprise.id) %> (<%= enterprise.enterprise_fees.count %>)
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -17,12 +17,29 @@ feature %q{
|
||||
end
|
||||
|
||||
scenario "listing enterprises" do
|
||||
e = create(:enterprise)
|
||||
s = create(:supplier_enterprise)
|
||||
d = create(:distributor_enterprise)
|
||||
|
||||
login_to_admin_section
|
||||
click_link 'Enterprises'
|
||||
|
||||
page.should have_content e.name
|
||||
within("tr.enterprise-#{s.id}") do
|
||||
page.should have_content s.name
|
||||
page.should have_content "Edit Profile"
|
||||
page.should have_content "Delete"
|
||||
page.should_not have_content "Payment Methods"
|
||||
page.should_not have_content "Shipping Methods"
|
||||
page.should have_content "Enterprise Fees"
|
||||
end
|
||||
|
||||
within("tr.enterprise-#{d.id}") do
|
||||
page.should have_content d.name
|
||||
page.should have_content "Edit Profile"
|
||||
page.should have_content "Delete"
|
||||
page.should have_content "Payment Methods"
|
||||
page.should have_content "Shipping Methods"
|
||||
page.should have_content "Enterprise Fees"
|
||||
end
|
||||
end
|
||||
|
||||
scenario "viewing an enterprise" do
|
||||
|
||||
Reference in New Issue
Block a user