blacklight 5.5.1 → 5.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +8 -16
- data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/facets_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +2 -1
- data/app/helpers/blacklight/url_helper_behavior.rb +5 -1
- data/app/views/catalog/_view_type_group.html.erb +1 -1
- data/blacklight.gemspec +2 -1
- data/gemfiles/rails3.gemfile +1 -1
- data/gemfiles/rails4.1.gemfile +1 -1
- data/gemfiles/rails4.gemfile +1 -1
- data/lib/blacklight/catalog.rb +0 -1
- data/lib/blacklight/solr/facet_paginator.rb +22 -10
- data/lib/generators/blacklight/install_generator.rb +1 -1
- data/spec/controllers/bookmarks_controller_spec.rb +6 -6
- data/spec/controllers/catalog_controller_spec.rb +48 -48
- data/spec/features/alternate_controller_spec.rb +3 -3
- data/spec/features/record_view_spec.rb +1 -1
- data/spec/features/search_filters_spec.rb +4 -4
- data/spec/features/search_results_spec.rb +12 -12
- data/spec/helpers/blacklight_helper_spec.rb +83 -83
- data/spec/helpers/catalog_helper_spec.rb +37 -37
- data/spec/helpers/configuration_helper_spec.rb +39 -39
- data/spec/helpers/facets_helper_spec.rb +37 -37
- data/spec/helpers/render_constraints_helper_spec.rb +6 -1
- data/spec/helpers/search_history_constraints_helper_spec.rb +9 -9
- data/spec/helpers/url_helper_spec.rb +49 -39
- data/spec/lib/blacklight/configurable_spec.rb +5 -5
- data/spec/lib/blacklight/configuration_spec.rb +8 -8
- data/spec/lib/blacklight/facet_paginator_spec.rb +25 -0
- data/spec/lib/blacklight/routes_spec.rb +4 -4
- data/spec/lib/blacklight/search_fields_spec.rb +3 -3
- data/spec/lib/blacklight/solr/document_spec.rb +2 -2
- data/spec/lib/blacklight/solr_helper_spec.rb +37 -37
- data/spec/lib/blacklight/solr_response/group_response_spec.rb +1 -1
- data/spec/lib/blacklight/solr_response_spec.rb +31 -31
- data/spec/lib/document_presenter_spec.rb +41 -41
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
- data/spec/models/record_mailer_spec.rb +1 -1
- data/spec/models/search_spec.rb +1 -1
- data/spec/routing/catalog_routing_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- data/spec/support/include_text.rb +2 -3
- data/spec/views/catalog/_constraints.html.erb_spec.rb +7 -7
- data/spec/views/catalog/_document.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_facets.html.erb_spec.rb +6 -6
- data/spec/views/catalog/_index_default.erb_spec.rb +10 -10
- data/spec/views/catalog/_index_header_default.html.erb_spec.rb +5 -5
- data/spec/views/catalog/_show_default.erb_spec.rb +10 -10
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +5 -5
- data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +4 -4
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +5 -2
- data/spec/views/catalog/facet.html.erb_spec.rb +5 -5
- data/spec/views/catalog/index.atom.builder_spec.rb +2 -2
- data/spec/views/catalog/index.html.erb_spec.rb +5 -5
- data/spec/views/catalog/show.html.erb_spec.rb +8 -8
- data/tasks/blacklight.rake +1 -2
- metadata +18 -4
@@ -6,15 +6,15 @@ describe "/catalog/_show_sidebar.html.erb" do
|
|
6
6
|
|
7
7
|
before(:each) do
|
8
8
|
|
9
|
-
view.
|
10
|
-
view.
|
11
|
-
view.
|
12
|
-
view.
|
9
|
+
allow(view).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
|
10
|
+
allow(view).to receive(:has_user_authentication_provider?).and_return(false)
|
11
|
+
allow(view).to receive(:current_search_session).and_return nil
|
12
|
+
allow(view).to receive(:search_session).and_return({})
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should show more-like-this titles in the sidebar" do
|
16
16
|
@document = SolrDocument.new :id => 1, :title_s => 'abc', :format => 'default'
|
17
|
-
@document.
|
17
|
+
allow(@document).to receive(:more_like_this).and_return([SolrDocument.new({ 'id' => '2', 'title_display' => 'Title of MLT Document' })])
|
18
18
|
render
|
19
19
|
expect(rendered).to include_text("More Like This")
|
20
20
|
expect(rendered).to include_text("Title of MLT Document")
|
@@ -7,7 +7,7 @@ describe "catalog/_sort_and_per_page" do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
before do
|
10
|
-
view.
|
10
|
+
allow(view).to receive_messages(blacklight_config: blacklight_config)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should render the pagination, sort, per page and view type controls" do
|
@@ -18,10 +18,10 @@ describe "catalog/_thumbnail_default" do
|
|
18
18
|
|
19
19
|
before do
|
20
20
|
assign :response, double(:params => {})
|
21
|
-
view.
|
22
|
-
view.
|
23
|
-
view.
|
24
|
-
view.
|
21
|
+
allow(view).to receive(:render_grouped_response?).and_return false
|
22
|
+
allow(view).to receive(:blacklight_config).and_return(blacklight_config)
|
23
|
+
allow(view).to receive(:current_search_session).and_return nil
|
24
|
+
allow(view).to receive(:search_session).and_return({})
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should render the thumbnail if the document has one" do
|
@@ -7,15 +7,17 @@ describe "catalog/_view_type_group" do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
before do
|
10
|
-
view.
|
10
|
+
allow(view).to receive_messages(how_sort_and_per_page?: true, blacklight_config: blacklight_config)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should not display the group when there's only one option" do
|
14
|
+
assign(:response, [])
|
14
15
|
render partial: 'catalog/view_type_group'
|
15
16
|
expect(rendered).to be_empty
|
16
17
|
end
|
17
18
|
|
18
19
|
it "should display the group" do
|
20
|
+
assign(:response, [double])
|
19
21
|
blacklight_config.configure do |config|
|
20
22
|
config.view.delete(:list)
|
21
23
|
config.view.a
|
@@ -31,6 +33,7 @@ describe "catalog/_view_type_group" do
|
|
31
33
|
|
32
34
|
|
33
35
|
it "should set the current view to 'active'" do
|
36
|
+
assign(:response, [double])
|
34
37
|
blacklight_config.configure do |config|
|
35
38
|
config.view.delete(:list)
|
36
39
|
config.view.a
|
@@ -42,4 +45,4 @@ describe "catalog/_view_type_group" do
|
|
42
45
|
expect(rendered).to have_selector('.btn', :text => 'B')
|
43
46
|
end
|
44
47
|
|
45
|
-
end
|
48
|
+
end
|
@@ -5,26 +5,26 @@ describe 'catalog/facet.html.erb' do
|
|
5
5
|
let(:blacklight_config) { Blacklight::Configuration.new }
|
6
6
|
before :each do
|
7
7
|
blacklight_config.add_facet_field 'xyz', label: "Facet title"
|
8
|
-
view.
|
8
|
+
allow(view).to receive(:blacklight_config).and_return(blacklight_config)
|
9
9
|
stub_template 'catalog/_facet_pagination.html.erb' => 'pagination'
|
10
10
|
assign :facet, blacklight_config.facet_fields['xyz']
|
11
11
|
assign :display_facet, display_facet
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should have the facet title" do
|
15
|
-
view.
|
15
|
+
allow(view).to receive(:render_facet_limit)
|
16
16
|
render
|
17
17
|
expect(rendered).to have_selector 'h3', text: "Facet title"
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should render facet pagination" do
|
21
|
-
view.
|
21
|
+
allow(view).to receive(:render_facet_limit)
|
22
22
|
render
|
23
23
|
expect(rendered).to have_content 'pagination'
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should render the facet limit" do
|
27
|
-
view.
|
27
|
+
allow(view).to receive(:render_facet_limit).with(display_facet, layout: false)
|
28
28
|
render
|
29
29
|
end
|
30
|
-
end
|
30
|
+
end
|
@@ -29,8 +29,8 @@ describe "catalog/index" do
|
|
29
29
|
# but okay.
|
30
30
|
|
31
31
|
params.merge!( @params )
|
32
|
-
view.
|
33
|
-
view.
|
32
|
+
allow(view).to receive(:blacklight_config).and_return(@config)
|
33
|
+
allow(view).to receive(:search_field_options_for_select).and_return([])
|
34
34
|
|
35
35
|
render :template => 'catalog/index', :formats => [:atom]
|
36
36
|
|
@@ -4,8 +4,8 @@ describe "catalog/index.html.erb" do
|
|
4
4
|
|
5
5
|
describe "with no search parameters" do
|
6
6
|
before do
|
7
|
-
view.
|
8
|
-
view.
|
7
|
+
allow(view).to receive(:has_search_parameters?).and_return(false)
|
8
|
+
allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
|
9
9
|
end
|
10
10
|
it "should render the sidebar and content panes" do
|
11
11
|
render
|
@@ -22,12 +22,12 @@ describe "catalog/index.html.erb" do
|
|
22
22
|
|
23
23
|
describe "with search parameters" do
|
24
24
|
before do
|
25
|
-
view.
|
25
|
+
allow(view).to receive(:has_search_parameters?).and_return(true)
|
26
26
|
stub_template "catalog/_results_pagination.html.erb" => ""
|
27
27
|
stub_template "catalog/_search_header.html.erb" => "header_content"
|
28
28
|
|
29
|
-
view.
|
30
|
-
view.
|
29
|
+
allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
|
30
|
+
allow(view).to receive(:render_opensearch_response_metadata).and_return("")
|
31
31
|
assign(:response, double(:empty? => true))
|
32
32
|
end
|
33
33
|
it "should render the search_header partial " do
|
@@ -11,14 +11,14 @@ describe "catalog/show.html.erb" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
before :each do
|
14
|
-
view.
|
15
|
-
view.
|
14
|
+
allow(view).to receive_messages(:has_user_authentication_provider? => false)
|
15
|
+
allow(view).to receive_messages(:render_document_sidebar_partial => "Sidebar")
|
16
16
|
assign :document, document
|
17
|
-
view.
|
17
|
+
allow(view).to receive(:blacklight_config).and_return(blacklight_config)
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should set the @page_title" do
|
21
|
-
view.
|
21
|
+
allow(view).to receive(:document_show_html_title).and_return("Heading")
|
22
22
|
render
|
23
23
|
page_title = view.instance_variable_get(:@page_title)
|
24
24
|
expect(page_title).to eq "Heading - Blacklight"
|
@@ -26,8 +26,8 @@ describe "catalog/show.html.erb" do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should include schema.org itemscope/type properties" do
|
29
|
-
view.
|
30
|
-
document.
|
29
|
+
allow(view).to receive(:document_show_html_title).and_return("Heading")
|
30
|
+
allow(document).to receive_messages(:itemtype => 'some-item-type-uri')
|
31
31
|
render
|
32
32
|
|
33
33
|
expect(rendered).to have_selector('div#document[@itemscope]')
|
@@ -35,7 +35,7 @@ describe "catalog/show.html.erb" do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it "should render the show_header and show partials by default" do
|
38
|
-
view.
|
38
|
+
allow(view).to receive(:render_grouped_response?).and_return(false)
|
39
39
|
stub_template "catalog/_show_header_default.html.erb" => "document_header"
|
40
40
|
stub_template "catalog/_show_default.html.erb" => "show_default"
|
41
41
|
|
@@ -47,7 +47,7 @@ describe "catalog/show.html.erb" do
|
|
47
47
|
|
48
48
|
|
49
49
|
it "should use the show.partials parameter to determine the partials to render" do
|
50
|
-
view.
|
50
|
+
allow(view).to receive(:render_grouped_response?).and_return(false)
|
51
51
|
blacklight_config.show.partials = ['a', 'b', 'c']
|
52
52
|
stub_template "catalog/_a_default.html.erb" => "a_partial"
|
53
53
|
stub_template "catalog/_b_default.html.erb" => "b_partial"
|
data/tasks/blacklight.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.
|
1
|
+
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.9.0.zip"
|
2
2
|
|
3
3
|
require 'jettywrapper'
|
4
4
|
require 'engine_cart/rake_task'
|
@@ -41,4 +41,3 @@ namespace :blacklight do
|
|
41
41
|
task :generate => ['engine_cart:generate'] do
|
42
42
|
end
|
43
43
|
end
|
44
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2014-07-
|
20
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -143,14 +143,14 @@ dependencies:
|
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
146
|
+
version: '3.0'
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: '
|
153
|
+
version: '3.0'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: rspec-its
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,6 +165,20 @@ dependencies:
|
|
165
165
|
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: rspec-collection_matchers
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '1.0'
|
175
|
+
type: :development
|
176
|
+
prerelease: false
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '1.0'
|
168
182
|
- !ruby/object:Gem::Dependency
|
169
183
|
name: capybara
|
170
184
|
requirement: !ruby/object:Gem::Requirement
|