Merge pull request 'Stabilize flaky remoteStorage Redis spec' (#252) from bugfix/rs-redis-spec-stabilization into master
CI / Test (push) Failing after 44s

Reviewed-on: #252
This commit was merged in pull request #252.
This commit is contained in:
raucao committed 2026-10-06 13:36:20 +00:00
commit d8bba02636
1 file changed
+3 -3
@@ -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