mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 04:23:37 +08:00
FIX: Update activation email route was returning a generic json error.
This commit is contained in:
parent
5a8d2b5e45
commit
95f9b72351
|
@ -749,7 +749,7 @@ class UsersController < ApplicationController
|
|||
enqueue_activation_email
|
||||
render json: success_json
|
||||
else
|
||||
render_json_error(@user)
|
||||
render_json_error(primary_email)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2200,7 +2200,7 @@ describe UsersController do
|
|||
email: 'updatedemail@example.com'
|
||||
}
|
||||
|
||||
expect(response).to be_success
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
user.reload
|
||||
expect(user.email).to eq('updatedemail@example.com')
|
||||
|
@ -2219,7 +2219,7 @@ describe UsersController do
|
|||
email: 'updatedemail@example.com'
|
||||
}
|
||||
|
||||
expect(response).to_not be_success
|
||||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
it "raises an error with an invalid password" do
|
||||
|
@ -2229,7 +2229,7 @@ describe UsersController do
|
|||
email: 'updatedemail@example.com'
|
||||
}
|
||||
|
||||
expect(response).to_not be_success
|
||||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
it "raises an error for an active user" do
|
||||
|
@ -2239,7 +2239,7 @@ describe UsersController do
|
|||
email: 'updatedemail@example.com'
|
||||
}
|
||||
|
||||
expect(response).to_not be_success
|
||||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
it "raises an error when logged in" do
|
||||
|
@ -2251,7 +2251,7 @@ describe UsersController do
|
|||
email: 'updatedemail@example.com'
|
||||
}
|
||||
|
||||
expect(response).to_not be_success
|
||||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
it "raises an error when the new email is taken" do
|
||||
|
@ -2263,7 +2263,7 @@ describe UsersController do
|
|||
email: user.email
|
||||
}
|
||||
|
||||
expect(response).to_not be_success
|
||||
expect(response.status).to eq(422)
|
||||
end
|
||||
|
||||
it "can be updated" do
|
||||
|
@ -2276,7 +2276,7 @@ describe UsersController do
|
|||
email: 'updatedemail@example.com'
|
||||
}
|
||||
|
||||
expect(response).to be_success
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
user.reload
|
||||
expect(user.email).to eq('updatedemail@example.com')
|
||||
|
|
Loading…
Reference in New Issue
Block a user