0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00
discourse-custom-wizard/spec/plugin_helper.rb

20 Zeilen
627 B
Ruby

# frozen_string_literal: true
2021-09-07 14:06:13 +02:00
def get_wizard_fixture(path)
JSON.parse(
2024-10-16 13:52:03 +02:00
File.open("#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/#{path}.json").read,
2021-09-07 14:06:13 +02:00
).with_indifferent_access
end
2022-03-25 17:08:24 +01:00
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
2024-10-16 13:52:03 +02:00
%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