mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 04:08:14 +08:00
FIX: respond with proper error message if user not found
This commit is contained in:
@ -122,11 +122,9 @@ describe UsersController do
|
||||
end
|
||||
|
||||
context 'missing token' do
|
||||
before do
|
||||
get "/u/password-reset/#{token}"
|
||||
end
|
||||
|
||||
it 'disallows login' do
|
||||
get "/u/password-reset/#{token}"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
expect(CGI.unescapeHTML(response.body))
|
||||
@ -138,6 +136,14 @@ describe UsersController do
|
||||
|
||||
expect(session[:current_user_id]).to be_blank
|
||||
end
|
||||
|
||||
it "responds with proper error message" do
|
||||
get "/u/password-reset/#{token}.json"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(JSON.parse(response.body)["message"]).to eq(I18n.t('password_reset.no_token'))
|
||||
expect(session[:current_user_id]).to be_blank
|
||||
end
|
||||
end
|
||||
|
||||
context 'invalid token' do
|
||||
|
Reference in New Issue
Block a user