From bd112c64b0f59045fc4e29e6d6effc22c6f257ac Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 18 Oct 2013 15:39:58 +1100 Subject: [PATCH] Fix edit enterprise link to point to edit page, fix spec breakages --- app/views/admin/enterprises/index.html.erb | 2 +- spec/features/admin/enterprises_spec.rb | 4 ++-- spec/models/spree/payment_method_spec.rb | 4 ++-- spec/models/spree/shipping_method_spec.rb | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/admin/enterprises/index.html.erb b/app/views/admin/enterprises/index.html.erb index 626c59deaf..85e662c97f 100644 --- a/app/views/admin/enterprises/index.html.erb +++ b/app/views/admin/enterprises/index.html.erb @@ -38,7 +38,7 @@ <%= enterprise.description %> - <%= link_to_with_icon('icon-edit', 'Edit Profile', main_app.admin_enterprise_path(enterprise), class: 'edit') %>
+ <%= link_to_with_icon('icon-edit', 'Edit Profile', main_app.edit_admin_enterprise_path(enterprise), class: 'edit') %>
<%= link_to_delete_enterprise enterprise %>
<%= link_to_with_icon 'icon-chevron-right', 'Payment Methods', spree.admin_payment_methods_path(enterprise_id: enterprise.id) %> (<%= enterprise.payment_methods.count %>)
diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 25ee869c1c..9e074dcc45 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -76,7 +76,7 @@ feature %q{ login_to_admin_section click_link 'Enterprises' - click_link 'Edit' + click_link 'Edit Profile' fill_in 'enterprise_name', :with => 'Eaterprises' fill_in 'enterprise_description', :with => 'Connecting farmers and eaters' @@ -156,7 +156,7 @@ feature %q{ scenario "can edit enterprises I have permission to" do click_link 'Enterprises' - within('#listing_enterprises tbody tr:first') { click_link 'Edit' } + within('#listing_enterprises tbody tr:first') { click_link 'Edit Profile' } fill_in 'enterprise_name', :with => 'Eaterprises' click_button 'Update' diff --git a/spec/models/spree/payment_method_spec.rb b/spec/models/spree/payment_method_spec.rb index 0193aa1425..173f5c807c 100644 --- a/spec/models/spree/payment_method_spec.rb +++ b/spec/models/spree/payment_method_spec.rb @@ -5,8 +5,8 @@ module Spree it "finds payment methods for a particular distributor" do d1 = create(:distributor_enterprise) d2 = create(:distributor_enterprise) - pm1 = create(:payment_method, distributors: [d1, d1]) - pm2 = create(:payment_method, distributors: [d2, d2]) + pm1 = create(:payment_method, distributors: [d1]) + pm2 = create(:payment_method, distributors: [d2]) PaymentMethod.for_distributor(d1).should == [pm1] end diff --git a/spec/models/spree/shipping_method_spec.rb b/spec/models/spree/shipping_method_spec.rb index 556ca037ce..91417b4827 100644 --- a/spec/models/spree/shipping_method_spec.rb +++ b/spec/models/spree/shipping_method_spec.rb @@ -21,8 +21,8 @@ module Spree it "finds shipping methods for a particular distributor" do d1 = create(:distributor_enterprise) d2 = create(:distributor_enterprise) - sm1 = create(:shipping_method, distributors: [d1, d1]) - sm2 = create(:shipping_method, distributors: [d2, d2]) + sm1 = create(:shipping_method, distributors: [d1]) + sm2 = create(:shipping_method, distributors: [d2]) ShippingMethod.for_distributor(d1).should == [sm1] end