lesson, this is why you don't mock

This commit is contained in:
Sam 2014-09-05 16:55:25 +10:00
parent e3f7d2a3ac
commit 2d615e4f8f
2 changed files with 2 additions and 2 deletions

View file

@ -9,7 +9,7 @@ module Jobs
User.real.where(trust_level: TrustLevel[3]).find_each do |u| User.real.where(trust_level: TrustLevel[3]).find_each do |u|
# Don't demote too soon after being promoted # Don't demote too soon after being promoted
next if UserHistory.for(u, :auto_trust_level_change) 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(previous_value: TrustLevel[2].to_s)
.where(new_value: TrustLevel[3].to_s) .where(new_value: TrustLevel[3].to_s)
.exists? .exists?

View file

@ -28,7 +28,7 @@ describe Jobs::LeaderPromotions do
end end
before do before do
SiteSetting.stubs(:leader_promotion_min_duration).returns(3) SiteSetting.tl3_promotion_min_duration = 3
end end
it "demotes if was promoted more than X days ago" do it "demotes if was promoted more than X days ago" do