mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Use POST for send_activation_email action
This commit is contained in:
@ -887,7 +887,7 @@ describe UsersController do
|
||||
context 'with a valid email_token' do
|
||||
it 'should send the activation email' do
|
||||
Jobs.expects(:enqueue).with(:user_email, has_entries(type: :signup))
|
||||
xhr :get, :send_activation_email, username: user.username
|
||||
xhr :post, :send_activation_email, username: user.username
|
||||
end
|
||||
end
|
||||
|
||||
@ -899,13 +899,13 @@ describe UsersController do
|
||||
|
||||
it 'should generate a new token' do
|
||||
expect {
|
||||
xhr :get, :send_activation_email, username: user.username
|
||||
xhr :post, :send_activation_email, username: user.username
|
||||
}.to change{ user.email_tokens(true).count }.by(1)
|
||||
end
|
||||
|
||||
it 'should send an email' do
|
||||
Jobs.expects(:enqueue).with(:user_email, has_entries(type: :signup))
|
||||
xhr :get, :send_activation_email, username: user.username
|
||||
xhr :post, :send_activation_email, username: user.username
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -913,7 +913,7 @@ describe UsersController do
|
||||
context 'when username does not exist' do
|
||||
it 'should not send an email' do
|
||||
Jobs.expects(:enqueue).never
|
||||
xhr :get, :send_activation_email, username: 'nopenopenopenope'
|
||||
xhr :post, :send_activation_email, username: 'nopenopenopenope'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user