From 84d2ffb47c707e4d41306285bf7d171b7ce796c7 Mon Sep 17 00:00:00 2001 From: Jon Jensen Date: Tue, 12 Sep 2017 17:32:22 -0600 Subject: [PATCH] spec: reset MultiCache fix :allthethings: Change-Id: I687529a965316c17d0c5c3e6d02282511a016801 Reviewed-on: https://gerrit.instructure.com/125849 Tested-by: Jenkins Reviewed-by: Cody Cutrer Product-Review: Cody Cutrer QA-Review: Cody Cutrer --- spec/controllers/eportfolios_controller_spec.rb | 1 + spec/lib/address_book/service_spec.rb | 1 + spec/lib/inst_fs_spec.rb | 1 + spec/lib/services/address_book_spec.rb | 1 + spec/lib/services/live_events_subscription_service_spec.rb | 1 + spec/lib/services/rich_content_spec.rb | 1 + spec/spec_helper.rb | 1 + spec/support/jwt_env.rb | 1 + 8 files changed, 8 insertions(+) diff --git a/spec/controllers/eportfolios_controller_spec.rb b/spec/controllers/eportfolios_controller_spec.rb index da5d5e631f2..0cfad4582cc 100644 --- a/spec/controllers/eportfolios_controller_spec.rb +++ b/spec/controllers/eportfolios_controller_spec.rb @@ -62,6 +62,7 @@ describe EportfoliosController do } before do + allow(Canvas::DynamicSettings).to receive(:find).with(any_args).and_call_original allow(Canvas::DynamicSettings).to receive(:find).with("canvas").and_return(fake_secrets) end diff --git a/spec/lib/address_book/service_spec.rb b/spec/lib/address_book/service_spec.rb index bd0290c1e6c..ce56879ec6d 100644 --- a/spec/lib/address_book/service_spec.rb +++ b/spec/lib/address_book/service_spec.rb @@ -19,6 +19,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../sharding_spec_helper.r describe AddressBook::Service do before do + allow(Canvas::DynamicSettings).to receive(:find).with(any_args).and_call_original allow(Canvas::DynamicSettings).to receive(:find). with("address-book", anything). and_return({'app-host' => 'http://test.host'}) diff --git a/spec/lib/inst_fs_spec.rb b/spec/lib/inst_fs_spec.rb index fa0fb14cf2e..98826d518d0 100644 --- a/spec/lib/inst_fs_spec.rb +++ b/spec/lib/inst_fs_spec.rb @@ -23,6 +23,7 @@ describe InstFS do before do @app_host = 'http://test.host' @secret = "supersecretyup" + allow(Canvas::DynamicSettings).to receive(:find).with(any_args).and_call_original allow(Canvas::DynamicSettings).to receive(:find). with(service: "inst-fs", default_ttl: 5.minutes). and_return({ diff --git a/spec/lib/services/address_book_spec.rb b/spec/lib/services/address_book_spec.rb index 3f8b7e934e9..bedb5edd98c 100644 --- a/spec/lib/services/address_book_spec.rb +++ b/spec/lib/services/address_book_spec.rb @@ -23,6 +23,7 @@ module Services before do @app_host = "address-book" @secret = "opensesame" + allow(Canvas::DynamicSettings).to receive(:find).with(any_args).and_call_original allow(Canvas::DynamicSettings).to receive(:find). with("address-book", default_ttl: 5.minutes). and_return({ "app-host" => @app_host, "secret" => Canvas::Security.base64_encode(@secret) }) diff --git a/spec/lib/services/live_events_subscription_service_spec.rb b/spec/lib/services/live_events_subscription_service_spec.rb index db6840dd990..8282617bddc 100644 --- a/spec/lib/services/live_events_subscription_service_spec.rb +++ b/spec/lib/services/live_events_subscription_service_spec.rb @@ -24,6 +24,7 @@ module Services context 'service unavailable' do before do + allow(Canvas::DynamicSettings).to receive(:find).with(any_args).and_call_original allow(Canvas::DynamicSettings).to receive(:find) .with('live-events-subscription-service', default_ttl: 5.minutes) .and_return(nil) diff --git a/spec/lib/services/rich_content_spec.rb b/spec/lib/services/rich_content_spec.rb index f2efeab38c9..f71bf5f4789 100644 --- a/spec/lib/services/rich_content_spec.rb +++ b/spec/lib/services/rich_content_spec.rb @@ -22,6 +22,7 @@ module Services describe RichContent do before do allow(Services::RichContent).to receive(:contextually_on).and_call_original + allow(Canvas::DynamicSettings).to receive(:find).with(any_args).and_call_original allow(Canvas::DynamicSettings).to receive(:find) .with('rich-content-service', default_ttl: 5.minutes) .and_return({ diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4ba90febd04..44a46fcf24c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -347,6 +347,7 @@ RSpec.configure do |config| Canvas::DynamicSettings.reset_cache! ActiveRecord::Migration.verbose = false RequestStore.clear! + MultiCache.reset Course.enroll_user_call_count = 0 $spec_api_tokens = {} end diff --git a/spec/support/jwt_env.rb b/spec/support/jwt_env.rb index cc92319110b..95363571db1 100644 --- a/spec/support/jwt_env.rb +++ b/spec/support/jwt_env.rb @@ -26,6 +26,7 @@ RSpec.shared_context "JWT setup" do } before do + allow(Canvas::DynamicSettings).to receive(:find).with(any_args).and_call_original allow(Canvas::DynamicSettings).to receive(:find).with("canvas").and_return(fake_secrets) end