spec: reset MultiCache

fix :allthethings:

Change-Id: I687529a965316c17d0c5c3e6d02282511a016801
Reviewed-on: https://gerrit.instructure.com/125849
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Jon Jensen 2017-09-12 17:32:22 -06:00 committed by Cody Cutrer
parent a572ec9ffd
commit 84d2ffb47c
8 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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'})

View File

@ -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({

View File

@ -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) })

View File

@ -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)

View File

@ -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({

View File

@ -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

View File

@ -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