Correctly stub self-registration in spec

pull/8452/head
Oliver Günther 4 years ago
parent 3f828d7fbd
commit cd9312120c
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 5
      spec/controllers/concerns/omniauth_login_spec.rb

@ -243,7 +243,8 @@ describe AccountController, type: :controller do
end
end
context 'with self-registration disabled' do
context 'with self-registration disabled',
with_settings: { self_registration: 0 } do
let(:omniauth_hash) do
OmniAuth::AuthHash.new(
provider: 'google',
@ -257,8 +258,6 @@ describe AccountController, type: :controller do
end
before do
allow(Setting).to receive(:self_registration?).and_return(false)
request.env['omniauth.auth'] = omniauth_hash
request.env['omniauth.origin'] = 'https://example.net/some_back_url'

Loading…
Cancel
Save