From 3884b0cc1b8c768811bf2d966e9da0712ea3c1ba Mon Sep 17 00:00:00 2001 From: Rob H Date: Wed, 18 Jun 2014 12:37:26 +1000 Subject: [PATCH] Adding a direct link to shopfront to enterprise edit page for distributor enterprises --- app/views/admin/enterprises/_form.html.haml | 9 +++++++++ spec/features/admin/enterprises_spec.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 9bc0fd0355..57ac4950ba 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -49,6 +49,15 @@ = f.radio_button :visible, false   = f.label :visible, "Not Visible", :value => "false" + - if @enterprise.is_distributor + - # TODO: Angularise this + .row + .three.columns.alpha + %label Link to shop front + .with-tip{'data-powertip' => "A direct link to your shopfront on the Open Food Network."} + %a What's this? + .eight.columns.omega + = main_app.shop_enterprise_url(@enterprise) = f.fields_for :address do |af| diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 8b5dcbb64a..fa2e47decc 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -41,7 +41,7 @@ feature %q{ click_link 'Enterprises' within("tr.enterprise-#{d.id}") do - page.should have_field "enterprise_set_collection_attributes_0_visible", checked: true + page.should have_checked_field "enterprise_set_collection_attributes_0_visible" uncheck "enterprise_set_collection_attributes_0_visible" end click_button "Update"