diff --git a/spec/controllers/super_admin/accounts_controller_spec.rb b/spec/controllers/super_admin/accounts_controller_spec.rb index 63cad0447..6b7e6eeed 100644 --- a/spec/controllers/super_admin/accounts_controller_spec.rb +++ b/spec/controllers/super_admin/accounts_controller_spec.rb @@ -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