blacklight 6.3.1 → 6.3.3
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.
- checksums.yaml +4 -4
- data/.rspec +2 -1
- data/README.md +2 -2
- data/VERSION +1 -1
- data/app/views/catalog/_bookmark_control.html.erb +2 -2
- data/blacklight.gemspec +1 -1
- data/lib/generators/blacklight/solr5_generator.rb +1 -1
- data/lib/generators/blacklight/user_generator.rb +2 -2
- data/spec/controllers/alternate_controller_spec.rb +0 -1
- data/spec/controllers/application_controller_spec.rb +0 -1
- data/spec/controllers/blacklight/base_spec.rb +0 -1
- data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +0 -1
- data/spec/controllers/blacklight/facet_spec.rb +0 -1
- data/spec/controllers/blacklight/search_fields_spec.rb +0 -1
- data/spec/controllers/blacklight/search_helper_spec.rb +0 -1
- data/spec/controllers/blacklight/suggest_search_spec.rb +0 -1
- data/spec/controllers/bookmarks_controller_spec.rb +0 -1
- data/spec/controllers/catalog_controller_spec.rb +0 -1
- data/spec/controllers/saved_searches_controller_spec.rb +0 -1
- data/spec/controllers/search_history_controller_spec.rb +0 -1
- data/spec/controllers/suggest_controller_spec.rb +0 -1
- data/spec/features/alternate_controller_spec.rb +0 -1
- data/spec/features/bookmarks_spec.rb +0 -1
- data/spec/features/did_you_mean_spec.rb +0 -1
- data/spec/features/facets_spec.rb +0 -1
- data/spec/features/record_view_spec.rb +0 -1
- data/spec/features/saved_searches_spec.rb +0 -1
- data/spec/features/search_context_spec.rb +0 -1
- data/spec/features/search_filters_spec.rb +0 -1
- data/spec/features/search_formats_spec.rb +0 -1
- data/spec/features/search_history_spec.rb +0 -1
- data/spec/features/search_pagination_spec.rb +0 -1
- data/spec/features/search_results_spec.rb +0 -1
- data/spec/features/search_sort_spec.rb +0 -1
- data/spec/features/search_spec.rb +0 -1
- data/spec/features/sitelinks_search_box.rb +0 -1
- data/spec/helpers/blacklight_helper_spec.rb +95 -153
- data/spec/helpers/catalog_helper_spec.rb +0 -1
- data/spec/helpers/configuration_helper_spec.rb +0 -1
- data/spec/helpers/deprecated_url_helper_behavior_spec.rb +0 -1
- data/spec/helpers/facets_helper_spec.rb +79 -113
- data/spec/helpers/hash_as_hidden_fields_spec.rb +0 -1
- data/spec/helpers/layout_helper_spec.rb +0 -1
- data/spec/helpers/render_constraints_helper_spec.rb +0 -1
- data/spec/helpers/search_history_constraints_helper_spec.rb +0 -1
- data/spec/helpers/suggest_helper_spec.rb +0 -1
- data/spec/helpers/url_helper_spec.rb +0 -1
- data/spec/lib/blacklight/parameters_spec.rb +0 -1
- data/spec/lib/blacklight/search_state_spec.rb +0 -1
- data/spec/lib/blacklight/utils_spec.rb +0 -1
- data/spec/lib/blacklight_spec.rb +0 -1
- data/spec/lib/tasks/blacklight_task_spec.rb +0 -1
- data/spec/models/blacklight/configurable_spec.rb +0 -1
- data/spec/models/blacklight/configuration/context_spec.rb +0 -1
- data/spec/models/blacklight/configuration_spec.rb +0 -1
- data/spec/models/blacklight/document/active_model_shim_spec.rb +0 -1
- data/spec/models/blacklight/document/cache_key_spec.rb +0 -1
- data/spec/models/blacklight/document/dublin_core_spec.rb +0 -1
- data/spec/models/blacklight/document/email_spec.rb +0 -1
- data/spec/models/blacklight/document/sms_spec.rb +0 -1
- data/spec/models/blacklight/document_spec.rb +0 -1
- data/spec/models/blacklight/facet_paginator_spec.rb +0 -1
- data/spec/models/blacklight/search_builder_spec.rb +0 -1
- data/spec/models/blacklight/solr/document/more_like_this_spec.rb +0 -1
- data/spec/models/blacklight/solr/document_spec.rb +0 -1
- data/spec/models/blacklight/solr/facet_paginator_spec.rb +0 -1
- data/spec/models/blacklight/solr/repository_spec.rb +0 -1
- data/spec/models/blacklight/solr/request_spec.rb +0 -1
- data/spec/models/blacklight/solr/response/facets_spec.rb +0 -1
- data/spec/models/blacklight/solr/response_spec.rb +0 -1
- data/spec/models/blacklight/solr/search_builder_spec.rb +0 -1
- data/spec/models/blacklight/suggest/response_spec.rb +0 -1
- data/spec/models/blacklight/user_spec.rb +0 -1
- data/spec/models/bookmark_spec.rb +0 -1
- data/spec/models/record_mailer_spec.rb +0 -1
- data/spec/models/search_spec.rb +0 -1
- data/spec/models/solr_document_spec.rb +0 -1
- data/spec/presenters/document_presenter_spec.rb +0 -1
- data/spec/presenters/index_presenter_spec.rb +0 -1
- data/spec/presenters/pipeline_spec.rb +0 -1
- data/spec/presenters/show_presenter_spec.rb +0 -1
- data/spec/spec_helper.rb +5 -8
- data/spec/test_app_templates/Gemfile.extra +1 -1
- data/spec/views/_user_util_links.html.erb_spec.rb +0 -1
- data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -1
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +0 -5
- data/spec/views/catalog/_document.html.erb_spec.rb +3 -14
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -4
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +0 -3
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +2 -7
- data/spec/views/catalog/_facets.html.erb_spec.rb +6 -14
- data/spec/views/catalog/_index_default.erb_spec.rb +4 -7
- data/spec/views/catalog/_index_header_default.html.erb_spec.rb +2 -5
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +3 -5
- data/spec/views/catalog/_search_header.erb_spec.rb +0 -2
- data/spec/views/catalog/_show_default.erb_spec.rb +7 -11
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +0 -1
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +3 -13
- data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +1 -5
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +0 -1
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +3 -11
- data/spec/views/catalog/facet.html.erb_spec.rb +0 -1
- data/spec/views/catalog/facet.json.jbuilder_spec.rb +0 -1
- data/spec/views/catalog/index.atom.builder_spec.rb +21 -36
- data/spec/views/catalog/index.html.erb_spec.rb +0 -3
- data/spec/views/catalog/index.json.jbuilder_spec.rb +0 -1
- data/spec/views/catalog/opensearch.xml.builder_spec.rb +0 -1
- data/spec/views/catalog/show.html.erb_spec.rb +2 -13
- metadata +7 -9
- data/spec/spec.opts +0 -4
data/spec/models/search_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
3
3
|
# Has been customized by Blacklight to work when application is in one place,
|
|
4
|
-
# and actual spec/ stuff is in another (the blacklight gem checkout).
|
|
4
|
+
# and actual spec/ stuff is in another (the blacklight gem checkout).
|
|
5
5
|
|
|
6
6
|
ENV["RAILS_ENV"] ||= 'test'
|
|
7
7
|
|
|
@@ -27,21 +27,18 @@ require 'rspec/collection_matchers'
|
|
|
27
27
|
require 'capybara/rspec'
|
|
28
28
|
require 'capybara/poltergeist'
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
Capybara.javascript_driver = :poltergeist
|
|
32
31
|
|
|
33
32
|
Capybara.register_driver :poltergeist do |app|
|
|
34
33
|
options = {}
|
|
35
|
-
|
|
36
34
|
options[:timeout] = 120 if RUBY_PLATFORM == "java"
|
|
37
|
-
|
|
38
35
|
Capybara::Poltergeist::Driver.new(app, options)
|
|
39
36
|
end
|
|
40
37
|
|
|
41
38
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
42
39
|
# in spec/support/ and its subdirectories.
|
|
43
|
-
# Blacklight, again, make sure we're looking in the right place for em.
|
|
44
|
-
# Relative to HERE, NOT to Rails.root, which is off somewhere else.
|
|
40
|
+
# Blacklight, again, make sure we're looking in the right place for em.
|
|
41
|
+
# Relative to HERE, NOT to Rails.root, which is off somewhere else.
|
|
45
42
|
Dir[Pathname.new(File.expand_path("../support/**/*.rb", __FILE__))].each {|f| require f}
|
|
46
43
|
|
|
47
44
|
RSpec.configure do |config|
|
|
@@ -53,12 +50,12 @@ RSpec.configure do |config|
|
|
|
53
50
|
# instead of true.
|
|
54
51
|
config.use_transactional_fixtures = true
|
|
55
52
|
|
|
56
|
-
if
|
|
57
|
-
# This is for an unreleased version of Devise (will either be 4.2 or 5.0)
|
|
53
|
+
if defined? Devise::Test::ControllerHelpers
|
|
58
54
|
config.include Devise::Test::ControllerHelpers, type: :controller
|
|
59
55
|
else
|
|
60
56
|
config.include Devise::TestHelpers, type: :controller
|
|
61
57
|
end
|
|
58
|
+
|
|
62
59
|
config.infer_spec_type_from_file_location!
|
|
63
60
|
|
|
64
61
|
config.include(ControllerLevelHelpers, type: :helper)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
require 'spec_helper'
|
|
3
2
|
|
|
4
3
|
describe "catalog/_constraints_element.html.erb" do
|
|
5
4
|
describe "for simple display" do
|
|
@@ -25,7 +24,6 @@ describe "catalog/_constraints_element.html.erb" do
|
|
|
25
24
|
expect(s).to have_selector(".remove[href='http://remove']")
|
|
26
25
|
end
|
|
27
26
|
end
|
|
28
|
-
|
|
29
27
|
it "has an accessible remove label" do
|
|
30
28
|
expect(rendered).to have_selector(".remove") do |s|
|
|
31
29
|
expect(s).to have_content("Remove constraint my label: my value")
|
|
@@ -50,8 +48,5 @@ describe "catalog/_constraints_element.html.erb" do
|
|
|
50
48
|
expect(rendered).to have_selector("span.appliedFilter.constraint span.filterName span.custom_label")
|
|
51
49
|
expect(rendered).to have_selector("span.appliedFilter.constraint span.filterValue span.custom_value")
|
|
52
50
|
end
|
|
53
|
-
|
|
54
51
|
end
|
|
55
|
-
|
|
56
|
-
|
|
57
52
|
end
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
require 'spec_helper'
|
|
3
2
|
|
|
4
3
|
describe "catalog/_document" do
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
let :blacklight_config do
|
|
10
|
-
Blacklight::Configuration.new
|
|
11
|
-
end
|
|
4
|
+
let(:document) { SolrDocument.new :id => 'xyz', :format => 'a' }
|
|
5
|
+
let(:blacklight_config) { Blacklight::Configuration.new }
|
|
12
6
|
|
|
13
7
|
before do
|
|
14
8
|
allow(view).to receive(:render_grouped_response?).and_return(false)
|
|
@@ -27,7 +21,6 @@ describe "catalog/_document" do
|
|
|
27
21
|
expect(rendered).to have_selector('div.document[@itemtype="http://schema.org/Thing"]')
|
|
28
22
|
end
|
|
29
23
|
|
|
30
|
-
|
|
31
24
|
it "uses the index.partials parameter to determine the partials to render" do
|
|
32
25
|
blacklight_config.index.partials = ['a', 'b', 'c']
|
|
33
26
|
stub_template "catalog/_a_default.html.erb" => "a_partial"
|
|
@@ -41,17 +34,13 @@ describe "catalog/_document" do
|
|
|
41
34
|
|
|
42
35
|
it 'has a css class with the document position' do
|
|
43
36
|
allow(view).to receive(:render_document_partials)
|
|
44
|
-
|
|
45
37
|
render partial: 'catalog/document', locals: { document: document, document_counter: 5 }
|
|
46
|
-
|
|
47
38
|
expect(rendered).to have_selector 'div.document-position-5'
|
|
48
39
|
end
|
|
49
40
|
|
|
50
41
|
it 'has a data attribute with the document position' do
|
|
51
42
|
allow(view).to receive(:render_document_partials)
|
|
52
|
-
|
|
53
43
|
render partial: 'catalog/document', locals: { document: document, document_counter: 5 }
|
|
54
|
-
|
|
55
44
|
expect(rendered).to have_selector 'div.document[@data-document-counter="5"]'
|
|
56
45
|
end
|
|
57
|
-
end
|
|
46
|
+
end
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
require 'spec_helper'
|
|
3
|
-
|
|
4
|
-
describe "catalog/_document_list", type: :view do
|
|
5
2
|
|
|
3
|
+
describe "catalog/_document_list", type: :view do
|
|
6
4
|
before do
|
|
7
5
|
allow(view).to receive_messages(document_index_view_type: "some-view", documents: [])
|
|
8
6
|
end
|
|
9
|
-
|
|
10
7
|
it "includes a class for the current view" do
|
|
11
8
|
render
|
|
12
9
|
expect(rendered).to have_selector(".documents-some-view")
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
require 'spec_helper'
|
|
3
2
|
|
|
4
3
|
describe 'catalog/_facet_index_navigation.html.erb', type: :view do
|
|
5
4
|
let(:pagination) { Blacklight::Solr::FacetPaginator.new([]) }
|
|
@@ -15,7 +14,6 @@ describe 'catalog/_facet_index_navigation.html.erb', type: :view do
|
|
|
15
14
|
|
|
16
15
|
it 'renders the facet index navigation range' do
|
|
17
16
|
render
|
|
18
|
-
|
|
19
17
|
expect(rendered).to have_selector '.pagination'
|
|
20
18
|
expect(rendered).to have_link '0', href: '/?facet.prefix=0&facet.sort=index'
|
|
21
19
|
expect(rendered).to have_link '1'
|
|
@@ -35,7 +33,6 @@ describe 'catalog/_facet_index_navigation.html.erb', type: :view do
|
|
|
35
33
|
render
|
|
36
34
|
expect(rendered).to have_selector '.active', text: '5'
|
|
37
35
|
end
|
|
38
|
-
|
|
39
36
|
it 'enables the clear facets button' do
|
|
40
37
|
render
|
|
41
38
|
expect(rendered).to have_link 'Clear Filter'
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
require 'spec_helper'
|
|
3
2
|
|
|
4
3
|
describe "catalog/facet_layout" do
|
|
5
|
-
|
|
6
4
|
let :blacklight_config do
|
|
7
5
|
Blacklight::Configuration.new do |config|
|
|
8
6
|
config.facet_fields[facet_field.field] = facet_field
|
|
@@ -19,7 +17,7 @@ describe "catalog/facet_layout" do
|
|
|
19
17
|
|
|
20
18
|
it "has a facet-specific class" do
|
|
21
19
|
render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
|
|
22
|
-
expect(rendered).to have_selector '.blacklight-some_field'
|
|
20
|
+
expect(rendered).to have_selector '.blacklight-some_field'
|
|
23
21
|
end
|
|
24
22
|
|
|
25
23
|
it "has a title with a link for a11y" do
|
|
@@ -38,8 +36,5 @@ describe "catalog/facet_layout" do
|
|
|
38
36
|
render partial: 'catalog/facet_layout', locals: { facet_field: facet_field }
|
|
39
37
|
expect(rendered).to_not have_selector '.panel-heading.collapsed'
|
|
40
38
|
expect(rendered).to have_selector '.in .panel-body'
|
|
41
|
-
|
|
42
39
|
end
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
end
|
|
40
|
+
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
require 'spec_helper'
|
|
3
2
|
|
|
4
3
|
describe "catalog/_facets" do
|
|
5
4
|
let(:blacklight_config) { Blacklight::Configuration.new }
|
|
@@ -26,13 +25,10 @@ describe "catalog/_facets" do
|
|
|
26
25
|
|
|
27
26
|
before do
|
|
28
27
|
blacklight_config.facet_fields['facet_field_1'] = facet_field
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@response = double()
|
|
35
|
-
allow(@response).to receive(:aggregations).and_return("facet_field_1" => @mock_display_facet_1)
|
|
28
|
+
@mock_display_facet_1 = double(:name => 'facet_field_1', sort: nil, offset: nil, prefix: nil, :items => [Blacklight::Solr::Response::Facets::FacetItem.new(:value => 'Value', :hits => 1234)])
|
|
29
|
+
allow(view).to receive_messages(:facet_field_names => [:facet_field_1], :facet_limit_for => 10)
|
|
30
|
+
@response = double()
|
|
31
|
+
allow(@response).to receive(:aggregations).and_return("facet_field_1" => @mock_display_facet_1)
|
|
36
32
|
end
|
|
37
33
|
|
|
38
34
|
it "has a header" do
|
|
@@ -41,23 +37,19 @@ describe "catalog/_facets" do
|
|
|
41
37
|
expect(rendered).to have_selector('.facets-heading')
|
|
42
38
|
end
|
|
43
39
|
|
|
44
|
-
|
|
45
40
|
describe "facet display" do
|
|
46
41
|
it "has a(n accessible) header" do
|
|
47
42
|
render
|
|
48
43
|
expect(rendered).to have_selector('.facet-field-heading')
|
|
49
44
|
end
|
|
50
|
-
|
|
51
45
|
it "lists values" do
|
|
52
46
|
render
|
|
53
|
-
|
|
54
47
|
# The .facet-content class is used by blacklight_range_limit js, and
|
|
55
48
|
# should be applied to the .panel-collapse div that contains the collapsible
|
|
56
|
-
# facet content. Please make sure it remains if possible.
|
|
49
|
+
# facet content. Please make sure it remains if possible.
|
|
57
50
|
expect(rendered).to have_selector('.facet-content a.facet_select')
|
|
58
|
-
expect(rendered).to have_selector('.facet-content .facet-count')
|
|
51
|
+
expect(rendered).to have_selector('.facet-content .facet-count')
|
|
59
52
|
end
|
|
60
53
|
end
|
|
61
54
|
end
|
|
62
55
|
end
|
|
63
|
-
|