Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-21 17:00:29 +01:00
Add product slug env variable
Dieser Commit ist enthalten in:
Ursprung
cd6503d425
Commit
af39c567ea
3 geänderte Dateien mit 28 neuen und 2 gelöschten Zeilen
|
@ -124,6 +124,8 @@ class CustomWizard::Subscription
|
|||
@product_slug = id_and_slug[:slug]
|
||||
end
|
||||
end
|
||||
|
||||
@product_slug ||= ENV["CUSTOM_WIZARD_PRODUCT_SLUG"]
|
||||
end
|
||||
|
||||
def includes?(feature, attribute, value = nil)
|
||||
|
@ -153,8 +155,8 @@ class CustomWizard::Subscription
|
|||
|
||||
def type
|
||||
return :none unless subscribed?
|
||||
return :standard if standard?
|
||||
return :business if business?
|
||||
return :standard if standard?
|
||||
return :community if community?
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
# name: discourse-custom-wizard
|
||||
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
|
||||
# version: 2.4.8
|
||||
# version: 2.4.9
|
||||
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
|
||||
# url: https://github.com/paviliondev/discourse-custom-wizard
|
||||
# contact_emails: development@pavilion.tech
|
||||
|
|
|
@ -147,4 +147,28 @@ describe CustomWizard::Subscription do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with environment variable" do
|
||||
before do
|
||||
ENV["CUSTOM_WIZARD_PRODUCT_SLUG"] = "standard"
|
||||
end
|
||||
|
||||
after do
|
||||
ENV["CUSTOM_WIZARD_PRODUCT_SLUG"] = nil
|
||||
end
|
||||
|
||||
it "enables the relevant subscription" do
|
||||
expect(described_class.type).to eq(:standard)
|
||||
end
|
||||
|
||||
context "with a subscription" do
|
||||
before do
|
||||
enable_subscription("business")
|
||||
end
|
||||
|
||||
it "respects the subscription" do
|
||||
expect(described_class.type).to eq(:business)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Laden …
In neuem Issue referenzieren