Spec to ensure that SSO respects blocked emails

This commit is contained in:
Robin Ward 2015-02-23 17:14:54 -05:00
parent ca5730018a
commit 34dc1f9e10
1 changed files with 14 additions and 0 deletions

View File

@ -82,6 +82,20 @@ describe SessionController do
expect(logged_on_user).to eq(nil) expect(logged_on_user).to eq(nil)
end end
it 'respects email restrictions' do
sso = get_sso('/a/')
sso.external_id = '666' # the number of the beast
sso.email = 'bob@bob.com'
sso.name = 'Sam Saffron'
sso.username = 'sam'
ScreenedEmail.block('bob@bob.com')
get :sso_login, Rack::Utils.parse_query(sso.payload)
logged_on_user = Discourse.current_user_provider.new(request.env).current_user
expect(logged_on_user).to eq(nil)
end
it 'allows you to create an admin account' do it 'allows you to create an admin account' do
sso = get_sso('/a/') sso = get_sso('/a/')
sso.external_id = '666' # the number of the beast sso.external_id = '666' # the number of the beast