Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
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.stubs("#{type}?".to_sym).returns(true)
|
||||||
CustomWizard::Subscription.any_instance.stubs("#{type}?".to_sym).returns(true)
|
CustomWizard::Subscription.any_instance.stubs("#{type}?".to_sym).returns(true)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context "without a subscription" do
|
context "without a subscription" do
|
||||||
|
before do
|
||||||
|
disable_subscriptions
|
||||||
|
end
|
||||||
|
|
||||||
it "returns the right subscription details" do
|
it "returns the right subscription details" do
|
||||||
get "/admin/wizards.json"
|
get "/admin/wizards.json"
|
||||||
expect(response.parsed_body["subscribed"]).to eq(false)
|
expect(response.parsed_body["subscribed"]).to eq(false)
|
||||||
|
|
Laden …
In neuem Issue referenzieren