mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: move more urgent emails notifications to critical queue
Move signup, admin login and password change email notifications to critical queue
This commit is contained in:
@ -486,7 +486,7 @@ describe Admin::UsersController do
|
||||
|
||||
context ".invite_admin" do
|
||||
it 'should invite admin' do
|
||||
Jobs.expects(:enqueue).with(:user_email, anything).returns(true)
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, anything).returns(true)
|
||||
xhr :post, :invite_admin, name: 'Bill', username: 'bill22', email: 'bill@bill.com'
|
||||
expect(response).to be_success
|
||||
|
||||
|
@ -210,7 +210,7 @@ describe SessionController do
|
||||
end
|
||||
|
||||
it 'sends an activation email' do
|
||||
Jobs.expects(:enqueue).with(:user_email, has_entries(type: :signup))
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, has_entries(type: :signup))
|
||||
sso = get_sso('/a/')
|
||||
sso.external_id = '666' # the number of the beast
|
||||
sso.email = 'bob@bob.com'
|
||||
@ -632,7 +632,7 @@ describe SessionController do
|
||||
end
|
||||
|
||||
it "enqueues an email" do
|
||||
Jobs.expects(:enqueue).with(:forgot_password, has_entries(user_id: user.id))
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, has_entries(type: :forgot_password, user_id: user.id))
|
||||
xhr :post, :forgot_password, login: user.username
|
||||
end
|
||||
end
|
||||
|
@ -321,7 +321,7 @@ describe UsersController do
|
||||
|
||||
context 'enqueues mail' do
|
||||
it 'enqueues mail with admin email and sso enabled' do
|
||||
Jobs.expects(:enqueue).with(:user_email, has_entries(type: :admin_login, user_id: admin.id))
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, has_entries(type: :admin_login, user_id: admin.id))
|
||||
put :admin_login, email: admin.email
|
||||
end
|
||||
end
|
||||
@ -417,7 +417,7 @@ describe UsersController do
|
||||
end
|
||||
|
||||
it 'creates a user correctly' do
|
||||
Jobs.expects(:enqueue).with(:user_email, has_entries(type: :signup))
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, has_entries(type: :signup))
|
||||
User.any_instance.expects(:enqueue_welcome_message).with('welcome_user').never
|
||||
|
||||
post_user
|
||||
@ -1297,7 +1297,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))
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, has_entries(type: :signup))
|
||||
xhr :post, :send_activation_email, username: user.username
|
||||
end
|
||||
end
|
||||
@ -1315,7 +1315,7 @@ describe UsersController do
|
||||
end
|
||||
|
||||
it 'should send an email' do
|
||||
Jobs.expects(:enqueue).with(:user_email, has_entries(type: :signup))
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, has_entries(type: :signup))
|
||||
xhr :post, :send_activation_email, username: user.username
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user