blacklight_range_limit 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,18 +47,21 @@ describe "Blacklight Range Limit with configured input labels" do
47
47
  before do
48
48
  CatalogController.blacklight_config = Blacklight::Configuration.new
49
49
  CatalogController.configure_blacklight do |config|
50
- config.add_facet_field 'pub_date_sort', :range => {
51
- :input_label_range_begin => 'from publication date',
52
- :input_label_range_end => 'to publication date'
50
+ config.add_facet_field 'pub_date_sort', range: {
51
+ input_label_range_begin: 'from publication date',
52
+ input_label_range_end: 'to publication date',
53
+ maxlength: 6
53
54
  }
54
55
  config.default_solr_params[:'facet.field'] = config.facet_fields.keys
55
56
  end
56
57
  end
57
58
 
58
- it "should show the range limit facet" do
59
+ it "should show the range limit facet with configured labels and maxlength" do
59
60
  visit '/catalog'
60
61
  expect(page).to have_selector 'label.sr-only[for="range_pub_date_sort_begin"]', :text => 'from publication date'
61
62
  expect(page).to have_selector 'label.sr-only[for="range_pub_date_sort_end"]', :text => 'to publication date'
63
+ expect(page).to have_selector 'input#range_pub_date_sort_begin[maxlength="6"]'
64
+ expect(page).to have_selector 'input#range_pub_date_sort_end[maxlength="6"]'
62
65
  end
63
66
 
64
67
  end
@@ -9,4 +9,11 @@ describe "Blacklight Range Limit Helper" do
9
9
  expect(begin_from_pub_html).to have_css 'label.sr-only[for="range_pub_date_begin"]'
10
10
  end
11
11
 
12
+ it "should render range text fields with specified maxlength, defaulting to 4 if not specified" do
13
+ html_maxlength_default = Capybara.string(helper.render_range_input('pub_date', 'begin'))
14
+ html_maxlength_6 = Capybara.string(helper.render_range_input('pub_date', 'begin', nil, 6))
15
+ expect(html_maxlength_default).to have_css 'input.form-control.range_begin#range_pub_date_begin[maxlength="4"]'
16
+ expect(html_maxlength_6).to have_css 'input.form-control.range_begin#range_pub_date_begin[maxlength="6"]'
17
+ end
18
+
12
19
  end
data/spec/spec_helper.rb CHANGED
@@ -1,20 +1,12 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
-
4
1
  ENV["RAILS_ENV"] ||= 'test'
5
-
6
2
  require 'rsolr'
7
-
8
3
  require 'engine_cart'
9
4
  EngineCart.load_application!
10
5
 
11
6
  require 'rspec/rails'
12
7
  require 'capybara/rspec'
13
8
 
14
-
15
9
  RSpec.configure do |config|
16
-
17
-
18
10
  # rspec-rails 3 will no longer automatically infer an example group's spec type
19
11
  # from the file location. You can explicitly opt-in to the feature using this
20
12
  # config option.
@@ -26,4 +18,3 @@ RSpec.configure do |config|
26
18
  # end
27
19
  config.infer_spec_type_from_file_location!
28
20
  end
29
-
@@ -0,0 +1 @@
1
+ ../fixtures/solr_documents
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_range_limit
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-26 00:00:00.000000000 Z
12
+ date: 2017-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -18,9 +18,6 @@ dependencies:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3.0'
21
- - - "<"
22
- - !ruby/object:Gem::Version
23
- version: '5.0'
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
@@ -28,9 +25,6 @@ dependencies:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: '3.0'
31
- - - "<"
32
- - !ruby/object:Gem::Version
33
- version: '5.0'
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: jquery-rails
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -49,22 +43,16 @@ dependencies:
49
43
  name: blacklight
50
44
  requirement: !ruby/object:Gem::Requirement
51
45
  requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 6.0.0.pre2
55
- - - "<"
46
+ - - "~>"
56
47
  - !ruby/object:Gem::Version
57
- version: '7'
48
+ version: '6.0'
58
49
  type: :runtime
59
50
  prerelease: false
60
51
  version_requirements: !ruby/object:Gem::Requirement
61
52
  requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- version: 6.0.0.pre2
65
- - - "<"
53
+ - - "~>"
66
54
  - !ruby/object:Gem::Version
67
- version: '7'
55
+ version: '6.0'
68
56
  - !ruby/object:Gem::Dependency
69
57
  name: rspec
70
58
  requirement: !ruby/object:Gem::Requirement
@@ -136,39 +124,33 @@ dependencies:
136
124
  - !ruby/object:Gem::Version
137
125
  version: '0'
138
126
  - !ruby/object:Gem::Dependency
139
- name: jettywrapper
127
+ name: solr_wrapper
140
128
  requirement: !ruby/object:Gem::Requirement
141
129
  requirements:
142
130
  - - "~>"
143
131
  - !ruby/object:Gem::Version
144
- version: '1.5'
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- version: 1.5.2
132
+ version: '0.14'
148
133
  type: :development
149
134
  prerelease: false
150
135
  version_requirements: !ruby/object:Gem::Requirement
151
136
  requirements:
152
137
  - - "~>"
153
138
  - !ruby/object:Gem::Version
154
- version: '1.5'
155
- - - ">="
156
- - !ruby/object:Gem::Version
157
- version: 1.5.2
139
+ version: '0.14'
158
140
  - !ruby/object:Gem::Dependency
159
141
  name: engine_cart
160
142
  requirement: !ruby/object:Gem::Requirement
161
143
  requirements:
162
144
  - - "~>"
163
145
  - !ruby/object:Gem::Version
164
- version: '0.8'
146
+ version: '1.0'
165
147
  type: :development
166
148
  prerelease: false
167
149
  version_requirements: !ruby/object:Gem::Requirement
168
150
  requirements:
169
151
  - - "~>"
170
152
  - !ruby/object:Gem::Version
171
- version: '0.8'
153
+ version: '1.0'
172
154
  description:
173
155
  email:
174
156
  - blacklight-development@googlegroups.com
@@ -177,6 +159,8 @@ extensions: []
177
159
  extra_rdoc_files: []
178
160
  files:
179
161
  - ".gitignore"
162
+ - ".rspec"
163
+ - ".solr_wrapper.yml"
180
164
  - ".travis.yml"
181
165
  - Gemfile
182
166
  - LICENSE
@@ -213,11 +197,29 @@ files:
213
197
  - lib/generators/blacklight_range_limit/install_generator.rb
214
198
  - lib/generators/blacklight_range_limit/templates/search_history_controller.rb
215
199
  - lib/tasks/blacklight_range_limit.rake
200
+ - solr/conf/_rest_managed.json
201
+ - solr/conf/admin-extra.html
202
+ - solr/conf/elevate.xml
203
+ - solr/conf/mapping-ISOLatin1Accent.txt
204
+ - solr/conf/protwords.txt
205
+ - solr/conf/schema.xml
206
+ - solr/conf/scripts.conf
207
+ - solr/conf/solrconfig.xml
208
+ - solr/conf/spellings.txt
209
+ - solr/conf/stopwords.txt
210
+ - solr/conf/stopwords_en.txt
211
+ - solr/conf/synonyms.txt
212
+ - solr/conf/xslt/example.xsl
213
+ - solr/conf/xslt/example_atom.xsl
214
+ - solr/conf/xslt/example_rss.xsl
215
+ - solr/conf/xslt/luke.xsl
216
+ - solr/sample_solr_documents.yml
216
217
  - spec/features/blacklight_range_limit_spec.rb
217
218
  - spec/fixtures/solr_documents/zero_year.yml
218
219
  - spec/helpers/blacklight_range_limit_helper_spec.rb
219
220
  - spec/spec_helper.rb
220
221
  - spec/test_app_templates/lib/generators/test_app_generator.rb
222
+ - spec/test_app_templates/solr_documents
221
223
  - vendor/assets/javascripts/bootstrap-slider.js
222
224
  - vendor/assets/javascripts/flot/excanvas.min.js
223
225
  - vendor/assets/javascripts/flot/jquery.flot.js
@@ -243,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
245
  version: '0'
244
246
  requirements: []
245
247
  rubyforge_project:
246
- rubygems_version: 2.4.5.1
248
+ rubygems_version: 2.5.1
247
249
  signing_key:
248
250
  specification_version: 4
249
251
  summary: Blacklight Range Limit plugin
@@ -253,3 +255,4 @@ test_files:
253
255
  - spec/helpers/blacklight_range_limit_helper_spec.rb
254
256
  - spec/spec_helper.rb
255
257
  - spec/test_app_templates/lib/generators/test_app_generator.rb
258
+ - spec/test_app_templates/solr_documents