mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
lesson, this is why you don't mock
This commit is contained in:
parent
e3f7d2a3ac
commit
2d615e4f8f
|
@ -9,7 +9,7 @@ module Jobs
|
|||
User.real.where(trust_level: TrustLevel[3]).find_each do |u|
|
||||
# Don't demote too soon after being promoted
|
||||
next if UserHistory.for(u, :auto_trust_level_change)
|
||||
.where('created_at >= ?', SiteSetting.leader_promotion_min_duration.to_i.days.ago)
|
||||
.where('created_at >= ?', SiteSetting.tl3_promotion_min_duration.to_i.days.ago)
|
||||
.where(previous_value: TrustLevel[2].to_s)
|
||||
.where(new_value: TrustLevel[3].to_s)
|
||||
.exists?
|
||||
|
|
|
@ -28,7 +28,7 @@ describe Jobs::LeaderPromotions do
|
|||
end
|
||||
|
||||
before do
|
||||
SiteSetting.stubs(:leader_promotion_min_duration).returns(3)
|
||||
SiteSetting.tl3_promotion_min_duration = 3
|
||||
end
|
||||
|
||||
it "demotes if was promoted more than X days ago" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user