mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: do not send tl1 welcome message when a user has the basic user badge
This commit is contained in:
@@ -82,6 +82,17 @@ describe Promotion do
|
||||
expect(job["args"][0]["message_type"]).to eq("welcome_tl1_user")
|
||||
end
|
||||
|
||||
it "does not not send when the user already has the tl1 badge when recalculcating" do
|
||||
SiteSetting.send_tl1_welcome_message = true
|
||||
BadgeGranter.grant(Badge.find(1), user)
|
||||
stat = user.user_stat
|
||||
stat.topics_entered = SiteSetting.tl1_requires_topics_entered
|
||||
stat.posts_read_count = SiteSetting.tl1_requires_read_posts
|
||||
stat.time_read = SiteSetting.tl1_requires_time_spent_mins * 60
|
||||
Promotion.recalculate(user)
|
||||
expect(Jobs::SendSystemMessage.jobs.length).to eq(0)
|
||||
end
|
||||
|
||||
it "can be turned off" do
|
||||
SiteSetting.send_tl1_welcome_message = false
|
||||
@result = promotion.review
|
||||
|
||||
Reference in New Issue
Block a user