Remove timecop dependence
This commit is contained in:
parent
c51e8ec3b5
commit
18aa827686
|
@ -16,19 +16,20 @@ RSpec.describe PostCreator do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should schedule a chat notification job' do
|
it 'should schedule a chat notification job' do
|
||||||
Timecop.freeze do
|
freeze_time
|
||||||
post = PostCreator.new(topic.user,
|
|
||||||
raw: 'Some post content',
|
|
||||||
topic_id: topic.id
|
|
||||||
).create!
|
|
||||||
|
|
||||||
job = Jobs::NotifyChats.jobs.last
|
post = PostCreator.new(topic.user,
|
||||||
|
raw: 'Some post content',
|
||||||
|
topic_id: topic.id
|
||||||
|
).create!
|
||||||
|
|
||||||
expect(job['at'])
|
job = Jobs::NotifyChats.jobs.last
|
||||||
.to eq((Time.zone.now + SiteSetting.chat_integration_delay_seconds.seconds).to_f)
|
|
||||||
|
expect(job['at'])
|
||||||
|
.to eq((Time.zone.now + SiteSetting.chat_integration_delay_seconds.seconds).to_f)
|
||||||
|
|
||||||
|
expect(job['args'].first['post_id']).to eq(post.id)
|
||||||
|
|
||||||
expect(job['args'].first['post_id']).to eq(post.id)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue