mirror of
https://github.com/discourse/discourse-chat-integration.git
synced 2025-07-06 22:02:14 +00:00
Workaround for intermittently failing redis spec
This commit is contained in:
parent
858533a788
commit
681f37bc2b
@ -304,12 +304,15 @@ RSpec.describe DiscourseChat::Manager do
|
|||||||
describe '.save_transcript' do
|
describe '.save_transcript' do
|
||||||
|
|
||||||
it 'saves a transcript to redis' do
|
it 'saves a transcript to redis' do
|
||||||
freeze_time
|
|
||||||
|
|
||||||
key = DiscourseChat::Helper.save_transcript("Some content here")
|
key = DiscourseChat::Helper.save_transcript("Some content here")
|
||||||
|
|
||||||
expect($redis.get("chat_integration:transcript:#{key}")).to eq("Some content here")
|
expect($redis.get("chat_integration:transcript:#{key}")).to eq("Some content here")
|
||||||
expect($redis.pttl("chat_integration:transcript:#{key}")).to eq(3600*1000)
|
|
||||||
|
ttl = $redis.pttl("chat_integration:transcript:#{key}")
|
||||||
|
|
||||||
|
# Slight hack since freeze_time doens't work on redis
|
||||||
|
expect($redis.pttl("chat_integration:transcript:#{key}")).to be <= (3601*1000)
|
||||||
|
expect($redis.pttl("chat_integration:transcript:#{key}")).to be >= (3599*1000)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user