Add test to check if posts are auto rebaked by PeriodicalUpdates job when gravatar download is disabled

follow-up for 8e307e633e
This commit is contained in:
Rishabh 2018-12-09 22:06:04 +05:30 committed by Sam
parent 502a0fe778
commit da41a515cd
1 changed files with 14 additions and 0 deletions

View File

@ -9,4 +9,18 @@ describe Jobs::PeriodicalUpdates do
Jobs::PeriodicalUpdates.new.execute(nil)
end
it "can rebake old posts when automatically_download_gravatars is false" do
SiteSetting.automatically_download_gravatars = false
post = create_post
post.update_columns(baked_at: Time.new(2000, 1, 1), baked_version: -1)
described_class.new.execute({})
post.reload
expect(post.baked_at).to be > 1.day.ago
baked = post.baked_at
described_class.new.execute({})
post.reload
expect(post.baked_at).to eq(baked)
end
end