mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 18:51:07 +08:00
FIX: deactivated users shouldn't be able to log in
This commit is contained in:
@ -195,6 +195,14 @@ describe SessionController do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'deactivated user' do
|
||||
it 'should return an error' do
|
||||
User.any_instance.stubs(:active).returns(false)
|
||||
xhr :post, :create, login: user.username, password: 'myawesomepassword'
|
||||
expect(JSON.parse(response.body)['error']).to eq(I18n.t('login.not_activated'))
|
||||
end
|
||||
end
|
||||
|
||||
describe 'success by username' do
|
||||
it 'logs in correctly' do
|
||||
xhr :post, :create, login: user.username, password: 'myawesomepassword'
|
||||
|
Reference in New Issue
Block a user