spec: mocha => rspec-mocks for initializers
Change-Id: Icaf253908a7b66c80878ca133bd758d52dfe5447 Reviewed-on: https://gerrit.instructure.com/120500 Tested-by: Jenkins Reviewed-by: Rob Orton <rob@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
86eae238a5
commit
f5fbc0b69d
|
@ -241,7 +241,7 @@ module ActiveRecord
|
|||
|
||||
context "with postgres 90300" do
|
||||
before do
|
||||
scope.connection.stubs(:postgresql_version).returns(90300)
|
||||
allow(scope.connection).to receive(:postgresql_version).and_return(90300)
|
||||
end
|
||||
|
||||
it "uses FOR UPDATE on a normal exclusive lock" do
|
||||
|
@ -255,7 +255,7 @@ module ActiveRecord
|
|||
|
||||
context "with postgres 90299" do
|
||||
before do
|
||||
scope.connection.stubs(:postgresql_version).returns(90299)
|
||||
allow(scope.connection).to receive(:postgresql_version).and_return(90299)
|
||||
end
|
||||
|
||||
it "uses FOR UPDATE on a normal exclusive lock" do
|
||||
|
|
|
@ -22,8 +22,8 @@ describe CanvasLinkedInConfig do
|
|||
|
||||
describe ".call" do
|
||||
it "returns a config with indifferent access" do
|
||||
plugin = stub(settings: {client_id: "abcdefg", client_secret_dec: "12345"})
|
||||
Canvas::Plugin.stubs(:find).with(:linked_in).returns(plugin)
|
||||
plugin = double(settings: {client_id: "abcdefg", client_secret_dec: "12345"})
|
||||
allow(Canvas::Plugin).to receive(:find).with(:linked_in).and_return(plugin)
|
||||
output = described_class.call
|
||||
expect(output['api_key']).to eq("abcdefg")
|
||||
expect(output[:api_key]).to eq("abcdefg")
|
||||
|
|
|
@ -53,8 +53,8 @@ describe 'ruby_version_compat' do
|
|||
testfile = fixture_file_upload("scribd_docs/txt.txt", "text/plain", true)
|
||||
testfile.instance_variable_set(:@original_filename, nil)
|
||||
controller = ApplicationController.new
|
||||
controller.stubs(:params).returns({ :upload => { :file1 => testfile } })
|
||||
controller.stubs(:request).returns(mock(:path => "/upload"))
|
||||
allow(controller).to receive(:params).and_return({ :upload => { :file1 => testfile } })
|
||||
allow(controller).to receive(:request).and_return(double(:path => "/upload"))
|
||||
expect { controller.force_utf8_params() }.to_not raise_error
|
||||
expect(testfile.original_filename).to be_nil
|
||||
end
|
||||
|
|
|
@ -22,8 +22,8 @@ describe CanvasTwitterConfig do
|
|||
|
||||
describe "#call" do
|
||||
it "returns a config with indifference access" do
|
||||
plugin = stub(settings: {consumer_key: "abcdefg", consumer_secret_dec: "12345"})
|
||||
Canvas::Plugin.stubs(:find).with(:twitter).returns(plugin)
|
||||
plugin = double(settings: {consumer_key: "abcdefg", consumer_secret_dec: "12345"})
|
||||
allow(Canvas::Plugin).to receive(:find).with(:twitter).and_return(plugin)
|
||||
output = described_class.call
|
||||
expect(output['api_key']).to eq("abcdefg")
|
||||
expect(output[:api_key]).to eq("abcdefg")
|
||||
|
|
Loading…
Reference in New Issue