From 184bf9ce36116d04ac20a384a778b90efda0d496 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 18 May 2018 13:50:00 +1000 Subject: [PATCH] Allow super admin users to enable subscriptions for enterprises --- .../form/_shop_preferences.html.haml | 26 +++++++++---------- spec/features/admin/enterprises_spec.rb | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/views/admin/enterprises/form/_shop_preferences.html.haml b/app/views/admin/enterprises/form/_shop_preferences.html.haml index 2b7e916eeb..fceac454aa 100644 --- a/app/views/admin/enterprises/form/_shop_preferences.html.haml +++ b/app/views/admin/enterprises/form/_shop_preferences.html.haml @@ -77,16 +77,16 @@ = f.radio_button :allow_order_changes, true, "ng-model" => "Enterprise.allow_order_changes", "ng-value" => "true" = f.label :allow_order_changes, t('.allow_order_changes_true'), value: :true - --# .row --# .alpha.eleven.columns --# .three.columns.alpha --# %label= t '.enable_subscriptions' --# %div{'ofn-with-tip' => t('.enable_subscriptions_tip')} --# %a= t 'admin.whats_this' --# .three.columns --# = f.radio_button :enable_subscriptions, true --# = f.label :enable_subscriptions, t('.enable_subscriptions_true'), value: :true --# .five.columns.omega --# = f.radio_button :enable_subscriptions, false --# = f.label :enable_subscriptions, t('.enable_subscriptions_false'), value: :false +- if spree_current_user.admin? + .row + .alpha.eleven.columns + .three.columns.alpha + %label= t '.enable_subscriptions' + %div{'ofn-with-tip' => t('.enable_subscriptions_tip')} + %a= t 'admin.whats_this' + .three.columns + = f.radio_button :enable_subscriptions, true + = f.label :enable_subscriptions, t('.enable_subscriptions_true'), value: :true + .five.columns.omega + = f.radio_button :enable_subscriptions, false + = f.label :enable_subscriptions, t('.enable_subscriptions_false'), value: :false diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 448933bac7..6ed07f5bd3 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -167,6 +167,7 @@ feature %q{ page.first("input[name='enterprise\[preferred_shopfront_message\]']", visible: false).set('This is my shopfront message.') page.should have_checked_field "enterprise_preferred_shopfront_order_cycle_order_orders_close_at" choose "enterprise_preferred_shopfront_order_cycle_order_orders_open_at" + choose "enterprise_enable_subscriptions_true" click_button 'Update' @@ -195,6 +196,7 @@ feature %q{ page.should have_content 'This is my shopfront message.' page.should have_checked_field "enterprise_preferred_shopfront_order_cycle_order_orders_open_at" expect(page).to have_checked_field "enterprise_require_login_true" + expect(page).to have_checked_field "enterprise_enable_subscriptions_true" end describe "producer properties" do