Use POST for send_activation_email action

This commit is contained in:
Neil Lalonde
2013-07-05 12:26:46 -04:00
parent a0f07f8914
commit 84ce04dfa5
4 changed files with 7 additions and 7 deletions

View File

@ -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