Ensure subscriptions are not stubbed if testing for no subscription
Dieser Commit ist enthalten in:
Ursprung
4bfea70dde
Commit
99e747a331
2 geänderte Dateien mit 15 neuen und 0 gelöschten Zeilen
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Laden …
In neuem Issue referenzieren