Skip to content

Commit

Permalink
Address rspec warnings by explicitly providing raise_error errors t…
Browse files Browse the repository at this point in the history
…o specs
  • Loading branch information
mejackreed committed Oct 12, 2015
1 parent 7608a49 commit ca3e0cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def export_as_mock
allow(controller).to receive(:get_search_results) { |*args| raise fake_error }
allow(controller.flash).to receive(:sweep)
allow(controller).to receive(:flash).and_return(:notice => I18n.t('blacklight.search.errors.request_error'))
expect { get :index, q: "+" }.to raise_error
expect { get :index, q: "+" }.to raise_error Blacklight::Exceptions::InvalidRequest
end

end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/saved_searches_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
session[:history] = [@one.id]
expect {
post :save, :id => @two.id
}.to raise_exception
}.to raise_error ActiveRecord::RecordNotFound
end

end
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/blacklight/search_fields_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MockConfig
expect { allow(@bad_config).to receive(:blacklight_config).and_return(Blacklight::Configuration.new { |config|
config.add_search_field :label => 'All Fields', :qt => 'all_fields'
config.add_search_field 'title', :qt => 'title_search'
}) }.to raise_error
}) }.to raise_error ArgumentError
end
end

Expand All @@ -66,7 +66,7 @@ class MockConfig
config.add_search_field 'my_key', :label => 'All Fields'
config.add_search_field 'my_key', :label => 'title'

}) }.to raise_error
}) }.to raise_error RuntimeError
end
end

Expand Down

0 comments on commit ca3e0cb

Please sign in to comment.