0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-15 22:32:54 +01:00
discourse-custom-wizard/spec/extensions/invites_controller_spec.rb

25 Zeilen
739 B
Ruby

require_relative '../plugin_helper'
2020-11-03 01:24:20 +01:00
describe InvitesControllerCustomWizard, type: :request do
fab!(:topic) { Fabricate(:topic) }
let(:invite) do
Invite.invite_by_email("angus@email.com", topic.user, topic)
end
let(:template) do
JSON.parse(File.open(
"#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/wizard.json"
).read)
end
2021-02-24 08:50:42 +01:00
2020-11-03 01:24:20 +01:00
before do
@controller = InvitesController.new
end
2021-02-24 08:50:42 +01:00
2020-11-03 01:24:20 +01:00
it "redirects a user to wizard after invite if after signup is enabled" do
template['after_signup'] = true
CustomWizard::Template.save(template, skip_jobs: true)
put "/invites/show/#{invite.invite_key}.json"
expect(response.parsed_body["redirect_to"]).to eq("/w/super-mega-fun-wizard")
2021-02-24 08:50:42 +01:00
end
end