From 0c1b1b4afe2da5656abc1f1eb46724d268d462f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Wed, 1 Nov 2023 21:49:08 +0100 Subject: [PATCH] Adjust specs for web app metadata fetching --- spec/jobs/remote_storage_expire_authorization_job_spec.rb | 7 ++++++- spec/models/remote_storage_authorization_spec.rb | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/jobs/remote_storage_expire_authorization_job_spec.rb b/spec/jobs/remote_storage_expire_authorization_job_spec.rb index 8142983..8e6cbb7 100644 --- a/spec/jobs/remote_storage_expire_authorization_job_spec.rb +++ b/spec/jobs/remote_storage_expire_authorization_job_spec.rb @@ -2,8 +2,13 @@ require 'rails_helper' RSpec.describe RemoteStorageExpireAuthorizationJob, type: :job do before do + allow_any_instance_of(AppCatalog::WebApp).to( + receive(:update_metadata).and_return(true) + ) + @user = create :user, cn: "ronald", ou: "kosmos.org" - @rs_authorization = create :remote_storage_authorization, user: @user, expire_at: 1.day.ago + @rs_authorization = create :remote_storage_authorization, + user: @user, expire_at: 1.day.ago end after do diff --git a/spec/models/remote_storage_authorization_spec.rb b/spec/models/remote_storage_authorization_spec.rb index e98625b..f3514e3 100644 --- a/spec/models/remote_storage_authorization_spec.rb +++ b/spec/models/remote_storage_authorization_spec.rb @@ -5,6 +5,10 @@ RSpec.describe RemoteStorageAuthorization, type: :model do let(:user) { create :user } + before do + allow_any_instance_of(AppCatalog::WebApp).to receive(:update_metadata).and_return(true) + end + describe "#create" do after(:each) { clear_enqueued_jobs } after(:all) { redis_rs_delete_keys("authorizations:*") }