mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
lesson, this is why you don't mock
This commit is contained in:
parent
e3f7d2a3ac
commit
2d615e4f8f
2 changed files with 2 additions and 2 deletions
|
@ -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 a new issue