diff --git a/spec/models/remote_storage_authorization_spec.rb b/spec/models/remote_storage_authorization_spec.rb index 2db3d7d..1791ab2 100644 --- a/spec/models/remote_storage_authorization_spec.rb +++ b/spec/models/remote_storage_authorization_spec.rb @@ -11,6 +11,7 @@ RSpec.describe RemoteStorageAuthorization, type: :model do end describe "#create" do + before(:each) { redis_rs_delete_keys("authorizations:*") } after(:each) { clear_enqueued_jobs } after(:all) { redis_rs_delete_keys("authorizations:*") } @@ -27,10 +28,9 @@ RSpec.describe RemoteStorageAuthorization, type: :model do end it "stores a token in redis" do - user_auth_keys = redis_rs.keys("authorizations:#{user.cn}:*") - expect(user_auth_keys.length).to eq(1) + auth - authorizations = redis_rs.smembers(user_auth_keys.first) + authorizations = redis_rs.smembers("authorizations:#{user.cn}:#{auth.token}") expect(authorizations.sort).to eq(%w(documents photos contacts:rw videos:r tasks/work:r).sort) end