mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: deactivated users shouldn't be able to log in
This commit is contained in:
parent
9fba385172
commit
1da59e7e2e
5 changed files with 20 additions and 4 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue