1
0
Fork 0
discourse-custom-wizard-unl.../spec/extensions/invites_controller_spec.rb
Faizaan Gagan b71548427d
Added files used by github actions workflows (#78)
* Added files used by github actions workflows

* added simplecov report for tests workflow

* removed trailing space

* Rubocop fixes

* Update plugin-linting.yml

* Create Gemfile.lock

* Update Gemfile.lock

* Re-add bundler

* Update gitignore

* Limit yarn install to dev

* Update rubocop config and gemfile.lock

* allow strings to be mutated

* Update invites_controller_spec.rb

Co-authored-by: angusmcleod <angus@mcleod.org.au>
2021-04-16 13:37:32 +05:30

24 Zeilen
759 B
Ruby

# frozen_string_literal: true
require_relative '../plugin_helper'
describe InvitesControllerCustomWizard, type: :request do
fab!(:topic) { Fabricate(:topic) }
let(:invite) { Invite.generate(topic.user, email: "angus@mcleod.org", topic: topic) }
let(:template) do
JSON.parse(File.open(
"#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/wizard.json"
).read)
end
before do
@controller = InvitesController.new
end
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(cookies[:destination_url]).to eq("/w/super-mega-fun-wizard")
end
end