test: ensure that timestamp is in correct range (#8868)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -49,7 +49,8 @@ RSpec.describe 'Super Admin accounts API', type: :request do
|
||||
expect(response).to have_http_status(:redirect)
|
||||
expect(flash[:notice]).to eq('Cache keys cleared')
|
||||
|
||||
expect(account.reload.cache_keys.values.all? { |v| v.to_i == now_timestamp }).to be(true)
|
||||
range = now_timestamp..(now_timestamp + 10)
|
||||
expect(account.reload.cache_keys.values.all? { |v| range.cover?(v.to_i) }).to be(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user