Skip to content

Commit

Permalink
Hacks to pass more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 13, 2016
1 parent 92c9255 commit 47c344e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions app/controllers/concerns/spotlight/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def exhibit_search_action_url(*args)

def exhibit_search_facet_url(*args)
options = args.extract_options!
options = params.merge(options).except(:exhibit_id, :only_path)

options = params.to_unsafe_h.merge(options).except(:exhibit_id, :only_path)
spotlight.facet_exhibit_catalog_url(current_exhibit, *args, options)
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/spotlight/searches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class SearchesController < Spotlight::ApplicationController
include Spotlight::Base

def create
@search.attributes = search_params
@search.query_params = params.except(:exhibit_id, :search, *blacklisted_search_session_params).reject { |_k, v| v.blank? }
@search.attributes = search_params.
@search.query_params = params.to_unsafe_h.except(:exhibit_id, :search, *blacklisted_search_session_params).reject { |_k, v| v.blank? }

if @search.save
redirect_to :back, notice: t(:'helpers.submit.search.created', model: @search.class.model_name.human.downcase)
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/spotlight/appearances_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
first_nav = exhibit.main_navigations.first
last_nav = exhibit.main_navigations.last
patch :update, exhibit_id: exhibit, exhibit: {
main_navigations_attributes: [
{ id: first_nav.id, label: 'Some Label', weight: 500 },
{ id: last_nav.id, display: false }
]
main_navigations_attributes: {
0 => { id: first_nav.id, label: 'Some Label', weight: 500 },
1 => { id: last_nav.id, display: false }
}
}
expect(flash[:notice]).to eq 'The exhibit was successfully updated.'
expect(response).to redirect_to edit_exhibit_appearance_path(exhibit)
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ENV['RAILS_ENV'] ||= 'test'

require 'factory_girl'
require 'database_cleaner'
require 'devise'
Expand Down Expand Up @@ -48,6 +47,7 @@

RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!

config.use_transactional_fixtures = false

Expand Down

0 comments on commit 47c344e

Please sign in to comment.