Skip to content

Commit

Permalink
Test Rails 4 using AC::Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jan 4, 2016
1 parent 61df7a0 commit 6891042
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,7 @@ def export_as_mock
end

describe "current_search_session" do
let(:parameter_class) do
Rails.version >= '5.0.0' ? ActionController::Parameters : HashWithIndifferentAccess
end
let(:parameter_class) { ActionController::Parameters }

it "should create a session if we're on an search action" do
allow(controller).to receive_messages(:action_name => "index")
Expand Down
4 changes: 1 addition & 3 deletions spec/helpers/deprecated_url_helper_behavior_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
end
end

let(:parameter_class) do
Rails.version >= '5.0.0' ? ActionController::Parameters : HashWithIndifferentAccess
end
let(:parameter_class) { ActionController::Parameters }
let(:search_state) { Blacklight::SearchState.new(params, blacklight_config) }
let(:params) { parameter_class.new }
let(:blacklight_config) { Blacklight::Configuration.new }
Expand Down
4 changes: 1 addition & 3 deletions spec/helpers/url_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
end
end

let(:parameter_class) do
Rails.version >= '5.0.0' ? ActionController::Parameters : HashWithIndifferentAccess
end
let(:parameter_class) { ActionController::Parameters }

before do
allow(helper).to receive(:search_action_path) do |*args|
Expand Down
4 changes: 1 addition & 3 deletions spec/lib/blacklight/search_state_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
end
end

let(:parameter_class) do
Rails.version >= '5.0.0' ? ActionController::Parameters : HashWithIndifferentAccess
end
let(:parameter_class) { ActionController::Parameters }
let(:helper) { described_class.new(params, blacklight_config) }
let(:params) { parameter_class.new }

Expand Down
4 changes: 1 addition & 3 deletions spec/presenters/document_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

subject { presenter }
let(:presenter) { Blacklight::DocumentPresenter.new(document, request_context, config) }
let(:parameter_class) do
Rails.version >= '5.0.0' ? ActionController::Parameters : HashWithIndifferentAccess
end
let(:parameter_class) { ActionController::Parameters }
let(:params) { parameter_class.new }
let(:search_state) { Blacklight::SearchState.new(params, config) }

Expand Down

0 comments on commit 6891042

Please sign in to comment.