Add invitations controller to Allow List (#10934)

This commit is contained in:
Ben Halpern 2020-10-19 16:31:26 -04:00 committed by GitHub
parent 8e57cf17ad
commit f62f5514f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -27,6 +27,7 @@ class ApplicationController < ActionController::Base
omniauth_callbacks
registrations
confirmations
invitations
passwords
health_checks].freeze
private_constant :PUBLIC_CONTROLLERS

View file

@ -0,0 +1,16 @@
require "rails_helper"
RSpec.describe "Invitations", type: :request do
let(:user) { create(:user) }
describe "Accept invitation" do
it "renders normal response even if site config is private" do
allow(SiteConfig).to receive(:public).and_return(false)
get "/users/invitation/accept?invitation_token=blahblahblahblah"
# This is a fake token, so the only thing we're testing for here is
# that we *do not* land on the "registrations" page which shouldn't
# interrupt the request, even for private forems.
expect(response.body).not_to include("registration__actions")
end
end
end