mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 05:52:49 +08:00
Fix the build
This commit is contained in:
parent
1c23aedccf
commit
f968b4e662
|
@ -243,8 +243,21 @@ describe InvitesController do
|
|||
xhr :put, :perform_accept_invitation, id: invite.invite_key, format: :json
|
||||
end
|
||||
|
||||
it "does not send password reset email if sso is enabled" do
|
||||
SiteSetting.enable_sso = true
|
||||
Jobs.expects(:enqueue).with(:invite_password_instructions_email, has_key(:username)).never
|
||||
xhr :put, :perform_accept_invitation, id: invite.invite_key, format: :json
|
||||
end
|
||||
|
||||
it "does not send password reset email if local login is disabled" do
|
||||
SiteSetting.enable_local_logins = false
|
||||
Jobs.expects(:enqueue).with(:invite_password_instructions_email, has_key(:username)).never
|
||||
xhr :put, :perform_accept_invitation, id: invite.invite_key, format: :json
|
||||
end
|
||||
|
||||
it 'sends an activation email if password is set' do
|
||||
user.password_hash = 'qaw3ni3h2wyr63lakw7pea1nrtr44pls'
|
||||
Jobs.expects(:enqueue).with(:invite_password_instructions_email, has_key(:username)).never
|
||||
Jobs.expects(:enqueue).with(:critical_user_email, has_entries(type: :signup, user_id: user.id))
|
||||
xhr :put, :perform_accept_invitation, id: invite.invite_key, format: :json
|
||||
end
|
||||
|
|
|
@ -213,33 +213,6 @@ describe Invite do
|
|||
|
||||
end
|
||||
|
||||
context 'enqueues a job to email "set password" instructions' do
|
||||
|
||||
it 'does not enqueue an email if sso is enabled' do
|
||||
SiteSetting.stubs(:enable_sso).returns(true)
|
||||
Jobs.expects(:enqueue).with(:invite_password_instructions_email, has_key(:username)).never
|
||||
invite.redeem
|
||||
end
|
||||
|
||||
it 'does not enqueue an email if local login is disabled' do
|
||||
SiteSetting.stubs(:enable_local_logins).returns(false)
|
||||
Jobs.expects(:enqueue).with(:invite_password_instructions_email, has_key(:username)).never
|
||||
invite.redeem
|
||||
end
|
||||
|
||||
it 'does not enqueue an email if the user has already set password' do
|
||||
Fabricate(:user, email: invite.email, password_hash: "7af7805c9ee3697ed1a83d5e3cb5a3a431d140933a87fdcdc5a42aeef9337f81")
|
||||
Jobs.expects(:enqueue).with(:invite_password_instructions_email, has_key(:username)).never
|
||||
invite.redeem
|
||||
end
|
||||
|
||||
it 'enqueues an email if all conditions are satisfied' do
|
||||
Jobs.expects(:enqueue).with(:invite_password_instructions_email, has_key(:username))
|
||||
invite.redeem
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "as a moderator" do
|
||||
it "will give the user a moderator flag" do
|
||||
invite.invited_by = Fabricate(:admin)
|
||||
|
|
Loading…
Reference in New Issue
Block a user