2020-11-03 01:24:20 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
describe CustomWizard::BasicWizardSerializer do
|
|
|
|
fab!(:user) { Fabricate(:user) }
|
2021-09-07 14:06:13 +02:00
|
|
|
let(:template) { get_wizard_fixture("wizard") }
|
2021-03-11 07:30:15 +01:00
|
|
|
|
2023-09-28 14:47:22 +02:00
|
|
|
before do
|
2023-09-28 15:27:24 +02:00
|
|
|
stub_out_subscription_classes
|
2023-09-28 14:47:22 +02:00
|
|
|
end
|
|
|
|
|
2020-11-03 01:24:20 +01:00
|
|
|
it 'should return basic wizard attributes' do
|
2021-09-07 14:06:13 +02:00
|
|
|
CustomWizard::Template.save(template, skip_jobs: true)
|
2020-11-03 01:24:20 +01:00
|
|
|
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
|
2021-03-11 07:30:15 +01:00
|
|
|
end
|