blacklight 4.7.0 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +13 -12
  4. data/Gemfile +37 -2
  5. data/VERSION +1 -1
  6. data/app/assets/stylesheets/blacklight/{_blacklight_base.css.scss → _blacklight_base.scss} +0 -0
  7. data/app/assets/stylesheets/blacklight/{_bookmark.css.scss → _bookmark.scss} +0 -0
  8. data/app/assets/stylesheets/blacklight/{_catalog.css.scss → _catalog.scss} +0 -0
  9. data/app/assets/stylesheets/blacklight/{_dropdown.css.scss → _dropdown.scss} +0 -0
  10. data/app/assets/stylesheets/blacklight/{_facets.css.scss → _facets.scss} +0 -0
  11. data/app/assets/stylesheets/blacklight/{_footer.css.scss → _footer.scss} +0 -0
  12. data/app/assets/stylesheets/blacklight/{_group.css.scss → _group.scss} +0 -0
  13. data/app/assets/stylesheets/blacklight/{_header.css.scss → _header.scss} +0 -0
  14. data/app/assets/stylesheets/blacklight/{_layout.css.scss → _layout.scss} +0 -0
  15. data/app/assets/stylesheets/blacklight/{_mixins.css.scss → _mixins.scss} +0 -0
  16. data/app/assets/stylesheets/blacklight/{_modal.css.scss → _modal.scss} +0 -0
  17. data/app/assets/stylesheets/blacklight/{_print.css.scss → _print.scss} +0 -0
  18. data/app/assets/stylesheets/blacklight/{_responsive.css.scss → _responsive.scss} +0 -0
  19. data/app/assets/stylesheets/blacklight/{_search_history.css.scss → _search_history.scss} +0 -0
  20. data/app/assets/stylesheets/blacklight/{blacklight.css.scss → blacklight.scss} +0 -0
  21. data/app/assets/stylesheets/blacklight/{blacklight_defaults.css.scss → blacklight_defaults.scss} +0 -0
  22. data/app/assets/stylesheets/blacklight/responsive_partials/{_catalog.css.scss → _catalog.scss} +0 -0
  23. data/app/assets/stylesheets/blacklight/responsive_partials/{_facets.css.scss → _facets.scss} +0 -0
  24. data/app/assets/stylesheets/blacklight/responsive_partials/{_header.css.scss → _header.scss} +0 -0
  25. data/app/helpers/blacklight/blacklight_helper_behavior.rb +2 -2
  26. data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -1
  27. data/app/helpers/blacklight/facets_helper_behavior.rb +1 -0
  28. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +2 -2
  29. data/blacklight.gemspec +5 -6
  30. data/lib/blacklight/catalog.rb +1 -1
  31. data/lib/blacklight/catalog/search_context.rb +6 -6
  32. data/lib/blacklight/solr/document.rb +29 -21
  33. data/lib/blacklight/solr_helper.rb +6 -4
  34. data/lib/generators/blacklight/templates/{blacklight.css.scss → blacklight.scss} +0 -0
  35. data/spec/controllers/application_controller_spec.rb +3 -3
  36. data/spec/controllers/bookmarks_controller_spec.rb +11 -11
  37. data/spec/controllers/catalog_controller_spec.rb +117 -117
  38. data/spec/controllers/search_history_controller_spec.rb +8 -8
  39. data/spec/features/alternate_controller_spec.rb +7 -5
  40. data/spec/features/record_view_spec.rb +4 -1
  41. data/spec/features/search_filters_spec.rb +37 -24
  42. data/spec/features/search_pagination_spec.rb +11 -7
  43. data/spec/features/search_results_spec.rb +22 -14
  44. data/spec/features/search_sort_spec.rb +3 -1
  45. data/spec/features/search_spec.rb +6 -0
  46. data/spec/helpers/blacklight_helper_spec.rb +175 -166
  47. data/spec/helpers/catalog_helper_spec.rb +59 -59
  48. data/spec/helpers/facets_helper_spec.rb +118 -118
  49. data/spec/helpers/hash_as_hidden_fields_spec.rb +14 -8
  50. data/spec/helpers/html_head_helper_spec.rb +51 -45
  51. data/spec/helpers/render_constraints_helper_spec.rb +5 -6
  52. data/spec/helpers/search_history_constraints_helper_spec.rb +21 -21
  53. data/spec/lib/blacklight/solr_response/group_response_spec.rb +2 -2
  54. data/spec/lib/blacklight_configurable_spec.rb +16 -16
  55. data/spec/lib/blacklight_configuration_spec.rb +132 -132
  56. data/spec/lib/blacklight_email_spec.rb +4 -4
  57. data/spec/lib/blacklight_sms_spec.rb +4 -4
  58. data/spec/lib/blacklight_solr_document_dublin_core_spec.rb +6 -6
  59. data/spec/lib/blacklight_solr_document_marc_spec.rb +3 -3
  60. data/spec/lib/blacklight_solr_document_more_like_this_spec.rb +4 -4
  61. data/spec/lib/blacklight_solr_document_spec.rb +36 -36
  62. data/spec/lib/blacklight_solr_response_spec.rb +42 -42
  63. data/spec/lib/blacklight_spec.rb +5 -5
  64. data/spec/lib/blacklight_user_spec.rb +5 -5
  65. data/spec/lib/facet_paginator_spec.rb +12 -12
  66. data/spec/lib/marc_export_spec.rb +746 -746
  67. data/spec/lib/search_fields_spec.rb +13 -13
  68. data/spec/lib/solr_helper_spec.rb +255 -250
  69. data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
  70. data/spec/lib/tasks/solr_marc_task_spec.rb +6 -6
  71. data/spec/lib/utils_spec.rb +11 -11
  72. data/spec/models/bookmark_spec.rb +7 -6
  73. data/spec/models/record_mailer_spec.rb +16 -16
  74. data/spec/models/search_spec.rb +8 -8
  75. data/spec/models/solr_document_spec.rb +7 -7
  76. data/spec/requests/alternate_controller_spec.rb +3 -3
  77. data/spec/routing/catalog_routing_spec.rb +10 -15
  78. data/spec/spec_helper.rb +6 -4
  79. data/spec/support/assert_difference.rb +2 -2
  80. data/spec/support/features.rb +11 -0
  81. data/spec/support/features/session_helpers.rb +3 -3
  82. data/spec/support/include_text.rb +2 -2
  83. data/spec/test_app_templates/Gemfile.extra +2 -15
  84. data/spec/test_app_templates/lib/generators/test_app_generator.rb +17 -6
  85. data/spec/views/catalog/_constraints.html.erb_spec.rb +7 -7
  86. data/spec/views/catalog/_constraints_element.html.erb_spec.rb +12 -12
  87. data/spec/views/catalog/_document.html.erb_spec.rb +1 -1
  88. data/spec/views/catalog/_facets.html.erb_spec.rb +13 -13
  89. data/spec/views/catalog/_index_default.erb_spec.rb +20 -20
  90. data/spec/views/catalog/_show_default.erb_spec.rb +20 -20
  91. data/spec/views/catalog/_show_sidebar.erb_spec.rb +6 -6
  92. data/spec/views/catalog/_thumbnail_default.erb_spec.rb +3 -3
  93. data/spec/views/catalog/index.atom.builder_spec.rb +28 -28
  94. data/spec/views/catalog/index.html.erb_spec.rb +6 -6
  95. metadata +35 -57
  96. data/gemfiles/rails3.gemfile +0 -25
  97. data/gemfiles/rails4.gemfile +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31257b25d32f93ef95d2451084d1126a7595af53
4
- data.tar.gz: dba5f44c198f0708326a11b450219b4d84227c80
3
+ metadata.gz: 59ca505fb4e5d581f138d8174d2caf775d7be43d
4
+ data.tar.gz: 7ac6cd3f2052f63bb6073f516f1fe11e8b6e686e
5
5
  SHA512:
6
- metadata.gz: c5c9a3f9d86b87a5eb9fd07e81a5fbefba16c909996e850dbeede4adc4ff1e87138fc4bdb126ff20a800fc1882fe3ef61470b294ca2523b5625c5f3812a59158
7
- data.tar.gz: 8730f957f7cded439289206f80b62692f012d4f1f365ed70798fe422441b15ac863d8551fc152def010638406caa49e9bfc3e9624a7fe7dfca5eeb68b9a0900d
6
+ metadata.gz: 84be88f72ad3f58add443566068ed14e4a2806f7b27c88ec35e0c83c2df376930f374e468011dc6feae0381a97fef684a58928a080c86d6b97c8dec666250379
7
+ data.tar.gz: b6c6056b286a416c7a5f86a853717f7cc2b502f9e7c21d238e1aee94b354d95824dfb1119c9f042c25a3ad098b37bd2f54240fc098587131fe561294e28aaa52
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ spec/internal
20
20
  pkg/*
21
21
  *.sw[pon]
22
22
  gemfiles/*.gemfile.lock
23
+ /.internal_test_app
data/.travis.yml CHANGED
@@ -1,18 +1,19 @@
1
- notifications:
2
- email: false
3
-
1
+ sudo: false
2
+ language: ruby
4
3
  rvm:
5
- - 1.9.3
6
- - jruby-19mode
7
- - 2.0.0
4
+ - 2.3.7
8
5
 
9
- gemfile:
10
- - gemfiles/rails3.gemfile
11
- - gemfiles/rails4.gemfile
6
+ matrix:
7
+ include:
8
+ - rvm: 2.3.7
9
+ env: "RAILS_VERSION=4.0.13"
10
+ - rvm: 2.3.7
11
+ env: "RAILS_VERSION=4.1.16"
12
+ - rvm: 2.3.7
13
+ env: "RAILS_VERSION=4.2.10"
12
14
 
13
15
  notifications:
14
16
  irc: "irc.freenode.org#blacklight"
15
- email:
16
- - blacklight-commits@googlegroups.com
17
+ email: false
17
18
 
18
- env: JRUBY_OPTS="-J-Xms512m -J-Xmx1024m"
19
+ env: JRUBY_OPTS="-J-Xms512m -J-Xmx1024m"
data/Gemfile CHANGED
@@ -1,19 +1,54 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Please see blacklight.gemspec for dependency information.
4
4
  gemspec
5
5
 
6
6
  gem 'simplecov', :platform => :mri
7
7
  gem 'simplecov-rcov', :platform => :mri
8
+ gem 'json', '~> 1.8'
8
9
 
9
10
  group :test do
10
11
  gem 'devise'
11
12
  gem 'devise-guests'
12
- gem "bootstrap-sass"
13
+ gem 'bootstrap-sass'
13
14
  gem 'turbolinks'
14
15
  gem 'poltergeist'
15
16
  end
16
17
 
18
+ # BEGIN ENGINE_CART BLOCK
19
+ # engine_cart: 1.0.1
20
+ # engine_cart stanza: 0.10.0
21
+ # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
22
+ file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
23
+ if File.exist?(file)
24
+ begin
25
+ eval_gemfile file
26
+ rescue Bundler::GemfileError => e
27
+ Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
28
+ Bundler.ui.warn e.message
29
+ end
30
+ else
31
+ Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
32
+ if ENV['RAILS_VERSION']
33
+ if ENV['RAILS_VERSION'] == 'edge'
34
+ gem 'rails', github: 'rails/rails'
35
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
36
+ else
37
+ gem 'rails', ENV['RAILS_VERSION']
38
+ end
39
+ end
40
+ case ENV['RAILS_VERSION']
41
+ when /^4.2/
42
+ gem 'responders', '~> 2.0'
43
+ gem 'sass-rails', '>= 5.0'
44
+ gem 'coffee-rails', '~> 4.1.0'
45
+ when /^4.[01]/
46
+ gem 'sass-rails', '< 5.0'
47
+ end
48
+ end
49
+ # END ENGINE_CART BLOCK
50
+
17
51
  if File.exists?('spec/test_app_templates/Gemfile.extra')
18
52
  eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra'
19
53
  end
54
+ gem 'transpec'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.7.0
1
+ 4.8.0
@@ -637,13 +637,13 @@ module Blacklight::BlacklightHelperBehavior
637
637
  end
638
638
 
639
639
  def link_to_previous_document(previous_document)
640
- link_to_unless previous_document.nil?, raw(t('views.pagination.previous')), previous_document, search_session_params(search_session[:counter].to_i - 1).merge(:class => "previous", :rel => 'prev') do
640
+ link_to_unless previous_document.nil?, raw(t('views.pagination.previous')), previous_document, search_session_params(search_session['counter'].to_i - 1).merge(:class => "previous", :rel => 'prev') do
641
641
  content_tag :span, raw(t('views.pagination.previous')), :class => 'previous'
642
642
  end
643
643
  end
644
644
 
645
645
  def link_to_next_document(next_document)
646
- link_to_unless next_document.nil?, raw(t('views.pagination.next')), next_document, search_session_params(search_session[:counter].to_i + 1).merge(:class => "next", :rel => 'next') do
646
+ link_to_unless next_document.nil?, raw(t('views.pagination.next')), next_document, search_session_params(search_session['counter'].to_i + 1).merge(:class => "next", :rel => 'next') do
647
647
  content_tag :span, raw(t('views.pagination.next')), :class => 'next'
648
648
  end
649
649
  end
@@ -105,7 +105,7 @@ module Blacklight::CatalogHelperBehavior
105
105
  # Code should call this method rather than interrogating session directly,
106
106
  # because implementation of where this data is stored/retrieved may change.
107
107
  def item_page_entry_info
108
- t('blacklight.search.entry_pagination_info.other', :current => number_with_delimiter(search_session[:counter]), :total => number_with_delimiter(search_session[:total]), :count => search_session[:total].to_i).html_safe
108
+ t('blacklight.search.entry_pagination_info.other', :current => number_with_delimiter(search_session['counter']), :total => number_with_delimiter(search_session['total']), :count => search_session['total'].to_i).html_safe
109
109
  end
110
110
 
111
111
  # Look up search field user-displayable label
@@ -195,6 +195,7 @@ module Blacklight::FacetsHelperBehavior
195
195
  p.delete :commit
196
196
  p[:f][field] = p[:f][field] - [value]
197
197
  p[:f].delete(field) if p[:f][field].size == 0
198
+ p.delete(:f) if p[:f].empty?
198
199
  p
199
200
  end
200
201
 
@@ -17,13 +17,13 @@ module Blacklight::SearchHistoryConstraintsHelperBehavior
17
17
  end
18
18
 
19
19
  def render_search_to_s_q(params)
20
- return "".html_safe if params[:q].blank?
20
+ return "".html_safe if params['q'].blank?
21
21
 
22
22
  label = (default_search_field && params[:search_field] == default_search_field[:key]) ?
23
23
  nil :
24
24
  label_for_search_field(params[:search_field])
25
25
 
26
- render_search_to_s_element(label , render_filter_value(params[:q]) )
26
+ render_search_to_s_element(label , render_filter_value(params['q']) )
27
27
  end
28
28
 
29
29
  def render_search_to_s_filters(params)
data/blacklight.gemspec CHANGED
@@ -12,26 +12,25 @@ Gem::Specification.new do |s|
12
12
  s.description = %q{Blacklight is an open source Solr user interface discovery platform. You can use Blacklight to enable searching and browsing of your collections. Blacklight uses the Apache Solr search engine to search full text and/or metadata.}
13
13
  s.license = "Apache 2.0"
14
14
  s.rubyforge_project = "blacklight"
15
-
15
+
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  # PRODUCTION GEM REQUIREMENTS
22
- # ---------------------------------------
23
- s.add_dependency "rails", ">= 3.2.6", "< 5"
22
+ # ---------------------------------------
23
+ s.add_dependency "rails", "~> 4.0"
24
24
  s.add_dependency "nokogiri", "~>1.6" # XML Parser
25
25
  # Let's allow future versions of marc, count on
26
26
  # them to be backwards compat until 1.1
27
27
  s.add_dependency "marc", ">= 0.4.3", "< 1.1" # Marc record parser.
28
28
  s.add_dependency "rsolr", "~> 1.0.6" # Library for interacting with rSolr.
29
29
  s.add_dependency "kaminari", "~> 0.13" # the pagination (page 1,2,3, etc..) of our search results
30
- s.add_dependency "sass-rails"
31
30
  s.add_dependency "bootstrap-sass", ">= 2.2.0", "< 2.4"
32
31
  s.add_dependency "deprecation", "~> 0.1"
33
32
  s.add_development_dependency "jettywrapper", ">= 1.4.1"
34
- s.add_development_dependency "rspec-rails"
35
- s.add_development_dependency 'engine_cart', ">= 0.1.0"
33
+ s.add_development_dependency "rspec-rails", "~> 3.0"
34
+ s.add_development_dependency 'engine_cart', "~> 2.0"
36
35
  s.add_development_dependency "equivalent-xml"
37
36
  end
@@ -65,7 +65,7 @@ module Blacklight::Catalog
65
65
 
66
66
  # updates the search counter (allows the show view to paginate)
67
67
  def update
68
- search_session[:counter] = params[:counter]
68
+ search_session['counter'] = params[:counter]
69
69
  redirect_to :action => "show"
70
70
  end
71
71
 
@@ -37,16 +37,16 @@ module Blacklight::Catalog::SearchContext
37
37
  rescue ActiveRecord::RecordNotFound
38
38
  nil
39
39
  end
40
- elsif search_session[:id]
40
+ elsif search_session['id']
41
41
  begin
42
- searches_from_history.find(search_session[:id])
42
+ searches_from_history.find(search_session['id'])
43
43
  rescue ActiveRecord::RecordNotFound
44
44
  nil
45
45
  end
46
46
  end
47
47
 
48
48
  if @current_search_session
49
- search_session[:id] = @current_search_session.id
49
+ search_session['id'] = @current_search_session.id
50
50
  end
51
51
 
52
52
  @current_search_session
@@ -94,11 +94,11 @@ module Blacklight::Catalog::SearchContext
94
94
  # calls setup_previous_document then setup_next_document.
95
95
  # used in the show action for single view pagination.
96
96
  def setup_next_and_previous_documents
97
- if search_session[:counter] and current_search_session
98
- index = search_session[:counter].to_i - 1
97
+ if search_session['counter'] and current_search_session
98
+ index = search_session['counter'].to_i - 1
99
99
  response, documents = get_previous_and_next_documents_for_search index, current_search_session.query_params
100
100
 
101
- search_session[:total] = response.total
101
+ search_session['total'] = response.total
102
102
  @search_context_response = response
103
103
  @previous_document = documents.first
104
104
  @next_document = documents.last
@@ -35,7 +35,7 @@ module Blacklight::Solr::Document
35
35
  included do
36
36
  extend ActiveModel::Naming
37
37
  include Blacklight::Solr::Document::Extensions
38
- end
38
+ end
39
39
 
40
40
  attr_reader :solr_response
41
41
 
@@ -59,7 +59,7 @@ module Blacklight::Solr::Document
59
59
  # Helper method to check if value/multi-values exist for a given key.
60
60
  # The value can be a string, or a RegExp
61
61
  # Multiple "values" can be given; only one needs to match.
62
- #
62
+ #
63
63
  # Example:
64
64
  # doc.has?(:location_facet)
65
65
  # doc.has?(:location_facet, 'Clemons')
@@ -83,7 +83,7 @@ module Blacklight::Solr::Document
83
83
 
84
84
  def has_highlight_field? k
85
85
  return false if @solr_response['highlighting'].blank? or @solr_response['highlighting'][self.id].blank?
86
-
86
+
87
87
  @solr_response['highlighting'][self.id].key? k.to_s
88
88
  end
89
89
 
@@ -128,33 +128,41 @@ module Blacklight::Solr::Document
128
128
  'catalog/document'
129
129
  end
130
130
 
131
-
131
+
132
132
  # Returns a hash keyed by semantic tokens (see ExtendableClassMethods#semantic_fields), value is an array of
133
133
  # strings. (Array to handle multi-value fields). If no value(s)
134
- # available, empty array is returned.
134
+ # available, empty array is returned.
135
135
  #
136
136
  # Default implementation here uses ExtendableClassMethods#semantic_fields
137
- # to just take values from Solr stored fields.
137
+ # to just take values from Solr stored fields.
138
138
  # Extensions can over-ride this method to provide better/different lookup,
139
139
  # but extensions should call super and modify hash returned, to avoid
140
- # unintentionally erasing values provided by other extensions.
140
+ # unintentionally erasing values provided by other extensions.
141
141
  def to_semantic_values
142
142
  unless @semantic_value_hash
143
- @semantic_value_hash = Hash.new([]) # default to empty array
143
+ @semantic_value_hash = Hash.new([]) # default to empty array
144
144
  self.class.field_semantics.each_pair do |key, solr_field|
145
145
  value = self[solr_field]
146
146
  # Make single and multi-values all arrays, so clients
147
147
  # don't have to know.
148
148
  unless value.nil?
149
- value = [value] unless value.kind_of?(Array)
149
+ value = [value] unless value.kind_of?(Array)
150
150
  @semantic_value_hash[key] = value
151
151
  end
152
152
  end
153
153
  end
154
154
  return @semantic_value_hash
155
155
  end
156
-
157
-
156
+
157
+ def to_model
158
+ self
159
+ end
160
+
161
+ def persisted?
162
+ true
163
+ end
164
+
165
+
158
166
  # Certain class-level methods needed for the document-specific
159
167
  # extendability architecture
160
168
  module ClassMethods
@@ -164,9 +172,9 @@ module Blacklight::Solr::Document
164
172
  # XXX Blacklight.config[:unique_key] should be deprecated soon
165
173
  if Blacklight.respond_to?(:config) and Blacklight.config[:unique_key]
166
174
  Deprecation.warn(self, "Setting the unique key using Blacklight.config[:unique_key] has been deprecated. Use the SolrDocument.unique_key= setter instead")
167
- @unique_key ||= Blacklight.config[:unique_key]
175
+ @unique_key ||= Blacklight.config[:unique_key]
168
176
  end
169
- @unique_key ||= 'id'
177
+ @unique_key ||= 'id'
170
178
 
171
179
  @unique_key
172
180
  end
@@ -175,11 +183,11 @@ module Blacklight::Solr::Document
175
183
  Deprecation.warn(self, "Document.connection is deprecated and will be removed in Blacklight 5.0")
176
184
  @connection ||= Blacklight.solr
177
185
  end
178
-
186
+
179
187
  # Returns array of hashes of registered extensions. Each hash
180
188
  # has a :module_obj key and a :condition_proc key. Usually this
181
189
  # method is only used internally in #apply_extensions, but if you
182
-
190
+
183
191
  # Class-level method for accessing/setting semantic mappings
184
192
  # for solr stored fields. Can be set by local app, key is
185
193
  # a symbol for a semantic, value is a solr _stored_ field.
@@ -189,13 +197,13 @@ module Blacklight::Solr::Document
189
197
  #
190
198
  # Currently documented semantic tokens, not all may be
191
199
  # used by core BL, but some may be used by plugins present
192
- # or future.
193
- # :title, :author, :year, :language => User-presentable strings.
200
+ # or future.
201
+ # :title, :author, :year, :language => User-presentable strings.
194
202
  def field_semantics
195
203
  @field_semantics ||= {}
196
- end
204
+ end
197
205
  end
198
-
199
-
200
-
206
+
207
+
208
+
201
209
  end
@@ -281,11 +281,14 @@ module Blacklight::SolrHelper
281
281
  fq = case
282
282
  when (facet_config and facet_config.query)
283
283
  facet_config.query[value][:fq]
284
- when (facet_config and facet_config.date),
285
- (value.is_a?(TrueClass) or value.is_a?(FalseClass) or value == 'true' or value == 'false'),
284
+ when (facet_config and facet_config.date)
285
+ # in solr 3.2+, this could be replaced by a !term query
286
+ "#{prefix}#{facet_field}:#{RSolr.escape(value)}"
287
+ when (value.is_a?(DateTime) or value.is_a?(Date) or value.is_a?(Time))
288
+ "#{prefix}#{facet_field}:#{RSolr.escape(value.to_time.utc.strftime("%Y-%m-%dT%H:%M:%SZ"))}"
289
+ when (value.is_a?(TrueClass) or value.is_a?(FalseClass) or value == 'true' or value == 'false'),
286
290
  (value.is_a?(Integer) or (value.to_i.to_s == value if value.respond_to? :to_i)),
287
291
  (value.is_a?(Float) or (value.to_f.to_s == value if value.respond_to? :to_f))
288
- (value.is_a?(DateTime) or value.is_a?(Date) or value.is_a?(Time))
289
292
  "#{prefix}#{facet_field}:#{value}"
290
293
  when value.is_a?(Range)
291
294
  "#{prefix}#{facet_field}:[#{value.first} TO #{value.last}]"
@@ -293,7 +296,6 @@ module Blacklight::SolrHelper
293
296
  "{!raw f=#{facet_field}#{(" " + local_params.join(" ")) unless local_params.empty?}}#{value}"
294
297
  end
295
298
 
296
-
297
299
  end
298
300
 
299
301
  ##
@@ -12,8 +12,8 @@ describe ApplicationController do
12
12
  controller.send(:default_html_head)
13
13
 
14
14
  # by default, these should be empty, but left in for backwards compatibility
15
- controller.javascript_includes.should be_empty
16
- controller.stylesheet_links.should be_empty
15
+ expect(controller.javascript_includes).to be_empty
16
+ expect(controller.stylesheet_links).to be_empty
17
17
  end
18
18
  end
19
19
  end
@@ -21,7 +21,7 @@ describe ApplicationController do
21
21
  describe "#blacklight_config" do
22
22
 
23
23
  it "should provide a default blacklight_config everywhere" do
24
- controller.blacklight_config.should == CatalogController.blacklight_config
24
+ expect(controller.blacklight_config).to eq(CatalogController.blacklight_config)
25
25
  end
26
26
  end
27
27