2021-03-11 07:30:15 +01:00
|
|
|
# frozen_string_literal: true
|
2020-11-03 01:24:20 +01:00
|
|
|
|
|
|
|
describe InvitesControllerCustomWizard, type: :request do
|
2024-10-16 13:52:03 +02:00
|
|
|
fab!(:topic)
|
2021-03-11 07:30:15 +01:00
|
|
|
let(:invite) { Invite.generate(topic.user, email: "angus@mcleod.org", topic: topic) }
|
2021-09-07 14:06:13 +02:00
|
|
|
let(:template) { get_wizard_fixture("wizard") }
|
2021-03-11 07:30:15 +01:00
|
|
|
|
2024-10-16 13:52:03 +02:00
|
|
|
before { @controller = InvitesController.new }
|
2021-03-11 07:30:15 +01:00
|
|
|
|
2020-11-03 01:24:20 +01:00
|
|
|
it "redirects a user to wizard after invite if after signup is enabled" do
|
2024-10-16 13:52:03 +02:00
|
|
|
template["after_signup"] = true
|
2020-11-03 01:24:20 +01:00
|
|
|
CustomWizard::Template.save(template, skip_jobs: true)
|
|
|
|
put "/invites/show/#{invite.invite_key}.json"
|
2021-04-16 10:07:32 +02:00
|
|
|
expect(cookies[:destination_url]).to eq("/w/super-mega-fun-wizard")
|
2021-03-11 07:30:15 +01:00
|
|
|
end
|
|
|
|
end
|