diff --git a/spec/helpers/helper_spec.rb b/spec/helpers/helper_spec.rb index 49f0fc0..ceda15f 100644 --- a/spec/helpers/helper_spec.rb +++ b/spec/helpers/helper_spec.rb @@ -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