diff --git a/spec/plugin_helper.rb b/spec/plugin_helper.rb index 5334c1fa..16585e16 100644 --- a/spec/plugin_helper.rb +++ b/spec/plugin_helper.rb @@ -12,3 +12,14 @@ def enable_subscription(type) CustomWizard::Subscription.stubs("#{type}?".to_sym).returns(true) CustomWizard::Subscription.any_instance.stubs("#{type}?".to_sym).returns(true) end + +def disable_subscriptions + %w[ + standard + business + community + ].each do |type| + CustomWizard::Subscription.stubs("#{type}?".to_sym).returns(false) + CustomWizard::Subscription.any_instance.stubs("#{type}?".to_sym).returns(false) + end +end diff --git a/spec/requests/custom_wizard/admin/admin_controller_spec.rb b/spec/requests/custom_wizard/admin/admin_controller_spec.rb index 6a7d721c..5e2b722c 100644 --- a/spec/requests/custom_wizard/admin/admin_controller_spec.rb +++ b/spec/requests/custom_wizard/admin/admin_controller_spec.rb @@ -14,6 +14,10 @@ describe CustomWizard::AdminController do end context "without a subscription" do + before do + disable_subscriptions + end + it "returns the right subscription details" do get "/admin/wizards.json" expect(response.parsed_body["subscribed"]).to eq(false)