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
|
||||
|
||||
it 'saves a transcript to redis' do
|
||||
freeze_time
|
||||
|
||||
key = DiscourseChat::Helper.save_transcript("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
|
||||
|
||||
|
|
Loading…
Reference in New Issue