Skip to content

Commit

Permalink
Get tests passing for Ruby 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Feb 24, 2014
1 parent a1cbcf3 commit 4725833
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,7 @@ notifications:
email: false

rvm:
- 2.1.1
- 2.1.0
- 2.0.0
- 1.9.3
Expand Down
Expand Up @@ -19,13 +19,13 @@ def render_search_to_s(params)
##
# Render the search query constraint
def render_search_to_s_q(params)
return "".html_safe if params[:q].blank?
return "".html_safe if params['q'].blank?

label = (default_search_field && params[:search_field] == default_search_field[:key]) ?
nil :
label_for_search_field(params[:search_field])

render_search_to_s_element(label , render_filter_value(params[:q]) )
render_search_to_s_element(label , render_filter_value(params['q']) )
end

##
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/blacklight/url_helper_behavior.rb
Expand Up @@ -140,7 +140,7 @@ def sanitize_search_params source_params
# Reset any search parameters that store search context
# and need to be reset when e.g. constraints change
def reset_search_params source_params
sanitize_search_params(source_params).except :page, :counter
sanitize_search_params(source_params).except(:page, :counter).with_indifferent_access
end

# adds the value and/or field to params[:f]
Expand Down Expand Up @@ -215,4 +215,4 @@ def remove_facet_params(field, item, source_params=params)
p
end

end
end
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Expand Up @@ -76,7 +76,7 @@ def assigns_response
expect(session[:search].keys).to include :id

search = Search.find(session[:search][:id])
expect(search.query_params[:q]).to eq @user_query
expect(search.query_params['q']).to eq @user_query
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/lib/blacklight/solr_helper_spec.rb
Expand Up @@ -730,9 +730,9 @@ def params
blacklight_config.stub(:default_solr_params).and_return({:qt => 'custom_request_handler'})
blacklight_solr.should_receive(:send_and_receive) do |path, params|
expect(path).to eq 'select'
expect(params[:params][:'facet.field']).to eq ["format", "{!ex=pub_date_single}pub_date", "subject_topic_facet", "language_facet", "lc_1letter_facet", "subject_geo_facet", "subject_era_facet"]
expect(params[:params][:"facet.query"]).to eq ["pub_date:[#{5.years.ago.year} TO *]", "pub_date:[#{10.years.ago.year} TO *]", "pub_date:[#{25.years.ago.year} TO *]"]
expect(params[:params]).to include(:rows => 10, :qt=>"custom_request_handler", :q=>"", "spellcheck.q"=>"", :"f.subject_topic_facet.facet.limit"=>21, :sort=>"score desc, pub_date_sort desc, title_sort asc")
expect(params[:params]['facet.field']).to eq ["format", "{!ex=pub_date_single}pub_date", "subject_topic_facet", "language_facet", "lc_1letter_facet", "subject_geo_facet", "subject_era_facet"]
expect(params[:params]["facet.query"]).to eq ["pub_date:[#{5.years.ago.year} TO *]", "pub_date:[#{10.years.ago.year} TO *]", "pub_date:[#{25.years.ago.year} TO *]"]
expect(params[:params]).to include('rows' => 10, 'qt'=>"custom_request_handler", 'q'=>"", "spellcheck.q"=>"", "f.subject_topic_facet.facet.limit"=>21, 'sort'=>"score desc, pub_date_sort desc, title_sort asc")
end.and_return({'response'=>{'docs'=>[]}})
get_search_results(:q => @all_docs_query)
end
Expand Down

0 comments on commit 4725833

Please sign in to comment.