Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 02:30:28 +01:00
35021eb176
I've tweaked the subscription client gem so we can just use the gem's models and tables in this plugin's rspec, which makes duplicating and stubbing them unnecessary. See further https://github.com/paviliondev/discourse_subscription_client
16 Zeilen
588 B
Ruby
16 Zeilen
588 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe CustomWizard::BasicWizardSerializer do
|
|
fab!(:user) { Fabricate(:user) }
|
|
let(:template) { get_wizard_fixture("wizard") }
|
|
|
|
it 'should return basic wizard attributes' do
|
|
CustomWizard::Template.save(template, skip_jobs: true)
|
|
json = CustomWizard::BasicWizardSerializer.new(
|
|
CustomWizard::Builder.new("super_mega_fun_wizard", user).build,
|
|
scope: Guardian.new(user)
|
|
).as_json
|
|
expect(json[:basic_wizard][:id]).to eq("super_mega_fun_wizard")
|
|
expect(json[:basic_wizard][:name]).to eq("Super Mega Fun Wizard")
|
|
end
|
|
end
|