Skip to content

Commit 1af9946

Browse files
committed
stubbing methods on nil is bad; change mock => double to fix deprecation warnings
1 parent 25a26ca commit 1af9946

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spec/controllers/catalog_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ def assigns_response
277277

278278
describe "@document" do
279279
before do
280+
@mock_response = double()
280281
@mock_response.stub(:docs => [{ :id => 'my_fake_doc' }])
281282
@mock_document = double()
282283
controller.stub(:find => @mock_response,
@@ -303,6 +304,7 @@ def export_as_mock
303304
end
304305
end
305306
before do
307+
@mock_response = double()
306308
@mock_response.stub(:docs => [{ :id => 'my_fake_doc' }])
307309
@mock_document = double()
308310
controller.stub(:find => @mock_response,

spec/views/catalog/_thumbnail_default.erb_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
end
1818

1919
before do
20-
assign :response, mock(:params => {})
20+
assign :response, double(:params => {})
2121
view.stub(:render_grouped_response?).and_return false
2222
view.stub(:blacklight_config).and_return(blacklight_config)
2323
end

0 commit comments

Comments
 (0)