blacklight 6.3.1 → 6.3.3
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
|
-
# spec for default partial to display solr document fields
|
5
|
-
# in catalog INDEX view
|
3
|
+
# spec for default partial to display solr document fields in catalog INDEX view
|
6
4
|
|
7
5
|
describe "/catalog/_index_default.erb" do
|
8
6
|
include BlacklightHelper
|
@@ -22,7 +20,6 @@ describe "/catalog/_index_default.erb" do
|
|
22
20
|
@fname_3 = "empty_field"
|
23
21
|
@fname_4 = "four_field"
|
24
22
|
|
25
|
-
|
26
23
|
@document = SolrDocument.new(id: 1, @fname_1 => "val_1", @fname_2 => "val2", @fname_4 => "val_4")
|
27
24
|
|
28
25
|
@flabel_1 = "One:"
|
@@ -38,7 +35,7 @@ describe "/catalog/_index_default.erb" do
|
|
38
35
|
expect(@rendered).to_not include("val_2")
|
39
36
|
expect(@rendered).to_not include(@fname_2)
|
40
37
|
end
|
41
|
-
|
38
|
+
|
42
39
|
it "skips over fields listed in initializer that are not in solr response" do
|
43
40
|
expect(@rendered).to_not include(@fname_3)
|
44
41
|
end
|
@@ -47,11 +44,11 @@ describe "/catalog/_index_default.erb" do
|
|
47
44
|
# labels
|
48
45
|
expect(@rendered).to include(@flabel_1)
|
49
46
|
expect(@rendered).to include(@flabel_4)
|
50
|
-
# classes
|
47
|
+
# classes
|
51
48
|
expect(@rendered).to include("blacklight-#{@fname_1}")
|
52
49
|
expect(@rendered).to include("blacklight-#{@fname_4}")
|
53
50
|
end
|
54
|
-
|
51
|
+
|
55
52
|
# this test probably belongs in a Cucumber feature
|
56
53
|
# it "should display fields in the order listed in the initializer" do
|
57
54
|
# pending
|
@@ -1,14 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe "catalog/_index_header_default" do
|
5
4
|
let :document do
|
6
5
|
SolrDocument.new :id => 'xyz', :format => 'a'
|
7
6
|
end
|
8
7
|
|
9
|
-
let
|
10
|
-
Blacklight::Configuration.new
|
11
|
-
end
|
8
|
+
let(:blacklight_config) { Blacklight::Configuration.new }
|
12
9
|
|
13
10
|
before do
|
14
11
|
allow(controller).to receive(:action_name).and_return('index')
|
@@ -30,7 +27,7 @@ describe "catalog/_index_header_default" do
|
|
30
27
|
render partial: "catalog/index_header_default", locals: {document: document, document_counter: 1}
|
31
28
|
expect(rendered).to have_selector '.index_title.col-md-12'
|
32
29
|
end
|
33
|
-
|
30
|
+
|
34
31
|
it "gives the document actions space if present" do
|
35
32
|
allow(view).to receive(:render_index_doc_actions).and_return("DOCUMENT ACTIONS")
|
36
33
|
render partial: "catalog/index_header_default", locals: {document: document, document_counter: 1}
|
@@ -1,18 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe "catalog/_paginate_compact.html.erb" do
|
5
4
|
let(:user) { User.new.tap { |u| u.save(validate: false) } }
|
6
|
-
|
5
|
+
|
7
6
|
before do
|
8
7
|
controller.request.path_parameters[:action] = 'index'
|
9
8
|
end
|
10
9
|
|
11
|
-
describe "with a real solr response", :integration => true do
|
10
|
+
describe "with a real solr response", :integration => true do
|
12
11
|
def blacklight_config
|
13
12
|
@config ||= CatalogController.blacklight_config
|
14
13
|
end
|
15
|
-
|
14
|
+
|
16
15
|
def blacklight_config=(config)
|
17
16
|
@config = config
|
18
17
|
end
|
@@ -25,7 +24,6 @@ describe "catalog/_paginate_compact.html.erb" do
|
|
25
24
|
|
26
25
|
it "renders solr responses" do
|
27
26
|
solr_response, document_list = search_results(q: '')
|
28
|
-
|
29
27
|
render :partial => 'catalog/paginate_compact', :object => solr_response
|
30
28
|
expect(rendered).to have_selector ".page_entries"
|
31
29
|
expect(rendered).to have_selector "a[@rel=next]"
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
# spec for sidebar partial in catalog show view
|
5
4
|
|
6
5
|
describe "/catalog/_search_header.html.erb" do
|
7
|
-
|
8
6
|
it "renders the default search header partials" do
|
9
7
|
stub_template "_did_you_mean.html.erb" => "did_you_mean"
|
10
8
|
stub_template "_constraints.html.erb" => "constraints"
|
@@ -1,15 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
|
-
# spec for default partial to display solr document fields
|
5
|
-
# in catalog show view
|
3
|
+
# spec for default partial to display solr document fields in catalog show view
|
6
4
|
|
7
5
|
describe "/catalog/_show_default.html.erb" do
|
8
|
-
|
6
|
+
|
9
7
|
include BlacklightHelper
|
10
8
|
include CatalogHelper
|
11
9
|
|
12
|
-
|
13
10
|
before(:each) do
|
14
11
|
allow(controller).to receive(:action_name).and_return('show')
|
15
12
|
@config = Blacklight::Configuration.new do |config|
|
@@ -23,9 +20,9 @@ describe "/catalog/_show_default.html.erb" do
|
|
23
20
|
@fname_2 = "solr_field_not_in_config"
|
24
21
|
@fname_3 = "empty_field"
|
25
22
|
@fname_4 = "four_field"
|
26
|
-
|
23
|
+
|
27
24
|
@document = SolrDocument.new(id: 1, @fname_1 => "val_1", @fname_2 => "val2", @fname_4 => "val_4")
|
28
|
-
|
25
|
+
|
29
26
|
@flabel_1 = "One:"
|
30
27
|
@flabel_3 = "Two:"
|
31
28
|
@flabel_4 = "Four:"
|
@@ -39,7 +36,7 @@ describe "/catalog/_show_default.html.erb" do
|
|
39
36
|
expect(@rendered).to_not include("val_2")
|
40
37
|
expect(@rendered).to_not include(@fname_2)
|
41
38
|
end
|
42
|
-
|
39
|
+
|
43
40
|
it "skips over fields listed in initializer that are not in solr response" do
|
44
41
|
expect(@rendered).to_not include(@fname_3)
|
45
42
|
end
|
@@ -48,11 +45,11 @@ describe "/catalog/_show_default.html.erb" do
|
|
48
45
|
# labels
|
49
46
|
expect(@rendered).to include(@flabel_1)
|
50
47
|
expect(@rendered).to include(@flabel_4)
|
51
|
-
# classes
|
48
|
+
# classes
|
52
49
|
expect(@rendered).to include("blacklight-#{@fname_1}")
|
53
50
|
expect(@rendered).to include("blacklight-#{@fname_4}")
|
54
51
|
end
|
55
|
-
|
52
|
+
|
56
53
|
# this test probably belongs in a Cucumber feature
|
57
54
|
# it "should display fields in the order listed in the initializer" do
|
58
55
|
# pending
|
@@ -63,5 +60,4 @@ describe "/catalog/_show_default.html.erb" do
|
|
63
60
|
expect(@rendered).to include("val_4")
|
64
61
|
expect(@rendered).to_not include("val_2")
|
65
62
|
end
|
66
|
-
|
67
63
|
end
|
@@ -1,14 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe "catalog/_show_tools.html.erb" 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
|
assign :response, double(:params => {})
|
@@ -18,11 +12,7 @@ describe "catalog/_show_tools.html.erb" do
|
|
18
12
|
end
|
19
13
|
|
20
14
|
describe "document actions" do
|
21
|
-
|
22
|
-
let :document_actions do
|
23
|
-
blacklight_config.show.document_actions
|
24
|
-
end
|
25
|
-
|
15
|
+
let(:document_actions) { blacklight_config.show.document_actions }
|
26
16
|
|
27
17
|
it "renders a document action" do
|
28
18
|
allow(view).to receive(:some_action_solr_document_path).with(document).and_return "x"
|
@@ -1,11 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe "catalog/_sort_and_per_page" do
|
5
|
-
|
6
|
-
let :blacklight_config do
|
7
|
-
Blacklight::Configuration.new
|
8
|
-
end
|
4
|
+
let(:blacklight_config) { Blacklight::Configuration.new }
|
9
5
|
|
10
6
|
before do
|
11
7
|
blacklight_config.add_results_collection_tool(:sort_widget)
|
@@ -1,19 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe "catalog/_view_type_group" do
|
5
|
-
|
6
|
-
let :blacklight_config do
|
7
|
-
Blacklight::Configuration.new
|
8
|
-
end
|
4
|
+
let(:blacklight_config) { Blacklight::Configuration.new }
|
9
5
|
|
10
6
|
before do
|
11
7
|
allow(view).to receive(:view_label) do |view|
|
12
8
|
view.to_s
|
13
9
|
end
|
14
|
-
|
15
10
|
allow(view).to receive_messages(how_sort_and_per_page?: true, blacklight_config: blacklight_config)
|
16
|
-
|
17
11
|
controller.request.path_parameters[:action] = 'index'
|
18
12
|
end
|
19
13
|
|
@@ -27,7 +21,7 @@ describe "catalog/_view_type_group" do
|
|
27
21
|
assign(:response, [double])
|
28
22
|
blacklight_config.configure do |config|
|
29
23
|
config.view.delete(:list)
|
30
|
-
config.view.a
|
24
|
+
config.view.a
|
31
25
|
config.view.b
|
32
26
|
config.view.c
|
33
27
|
end
|
@@ -38,12 +32,11 @@ describe "catalog/_view_type_group" do
|
|
38
32
|
expect(rendered).to have_selector('.view-type-c', :text => 'c')
|
39
33
|
end
|
40
34
|
|
41
|
-
|
42
35
|
it "sets the current view to 'active'" do
|
43
36
|
assign(:response, [double])
|
44
37
|
blacklight_config.configure do |config|
|
45
38
|
config.view.delete(:list)
|
46
|
-
config.view.a
|
39
|
+
config.view.a
|
47
40
|
config.view.b
|
48
41
|
end
|
49
42
|
render partial: 'catalog/view_type_group'
|
@@ -51,5 +44,4 @@ describe "catalog/_view_type_group" do
|
|
51
44
|
expect(rendered).to_not have_selector('.active', :text => 'b')
|
52
45
|
expect(rendered).to have_selector('.btn', :text => 'b')
|
53
46
|
end
|
54
|
-
|
55
47
|
end
|
@@ -1,36 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
require 'rexml/document'
|
4
3
|
|
5
4
|
describe "catalog/index" do
|
6
|
-
|
7
|
-
before(:all) do
|
8
|
-
@response = Blacklight::Solr::Response.new({ response: { numFound: 30 }}, { start: 10, rows: 10})
|
9
|
-
@config = CatalogController.blacklight_config
|
10
|
-
end
|
11
|
-
|
12
5
|
let(:document_list) do
|
13
|
-
10.times.map
|
6
|
+
10.times.map do |i|
|
7
|
+
doc = SolrDocument.new(id: i)
|
8
|
+
allow(doc).to receive(:export_as_some_format).and_return("")
|
9
|
+
allow(doc).to receive(:to_semantic_values).and_return(author: ['xyz']) if i == 0
|
10
|
+
doc.will_export_as(:some_format, "application/some-format") if i == 1
|
11
|
+
doc
|
12
|
+
end
|
14
13
|
end
|
15
14
|
|
16
15
|
before do
|
17
|
-
|
18
|
-
params['content_format'] = 'some_format'
|
16
|
+
@response = Blacklight::Solr::Response.new({ response: { numFound: 30 }}, { start: 10, rows: 10})
|
19
17
|
@document_list = document_list
|
20
|
-
|
21
|
-
allow(
|
22
|
-
|
23
|
-
|
24
|
-
allow(view).to receive(:blacklight_config).and_return(@config)
|
18
|
+
params['content_format'] = 'some_format'
|
19
|
+
allow(view).to receive(:action_name).and_return('index')
|
20
|
+
allow(view).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
|
25
21
|
allow(view).to receive(:search_field_options_for_select).and_return([])
|
26
|
-
|
27
22
|
render template: 'catalog/index', formats: [:atom]
|
28
23
|
end
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
REXML::Document.new(rendered)
|
33
|
-
end
|
25
|
+
# We need to use rexml to test certain things that have_tag wont' test
|
26
|
+
let(:response_xml) { REXML::Document.new(rendered) }
|
34
27
|
|
35
28
|
it "has contextual information" do
|
36
29
|
expect(rendered).to have_selector("link[rel=self]")
|
@@ -80,29 +73,23 @@ describe "catalog/index" do
|
|
80
73
|
end
|
81
74
|
|
82
75
|
describe "with an author" do
|
83
|
-
|
84
|
-
@entry = response_xml.elements.to_a("/feed/entry")[0]
|
85
|
-
end
|
76
|
+
let(:entry) { response_xml.elements.to_a("/feed/entry")[0] }
|
86
77
|
it "has author tag" do
|
87
|
-
expect(
|
78
|
+
expect(entry.elements["author/name"].text).to eq 'xyz'
|
88
79
|
end
|
89
80
|
end
|
90
81
|
|
91
82
|
describe "without an author" do
|
92
|
-
|
93
|
-
@entry = response_xml.elements.to_a("/feed/entry")[1]
|
94
|
-
end
|
83
|
+
let(:entry) { response_xml.elements.to_a("/feed/entry")[1] }
|
95
84
|
it "does not have an author tag" do
|
96
|
-
expect(
|
85
|
+
expect(entry.elements["author/name"]).to be_nil
|
97
86
|
end
|
98
87
|
end
|
99
88
|
end
|
100
89
|
|
101
90
|
describe "when content_format is specified" do
|
102
91
|
describe "for an entry with content available" do
|
103
|
-
let(:entry)
|
104
|
-
response_xml.elements.to_a("/feed/entry")[1].to_s
|
105
|
-
end
|
92
|
+
let(:entry) { response_xml.elements.to_a("/feed/entry")[1].to_s }
|
106
93
|
it "includes a link rel tag" do
|
107
94
|
expect(entry).to have_selector("link[rel=alternate][type='application/some-format']")
|
108
95
|
end
|
@@ -111,11 +98,9 @@ describe "catalog/index" do
|
|
111
98
|
end
|
112
99
|
end
|
113
100
|
describe "for an entry with NO content available" do
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
it "includes content" do
|
118
|
-
expect(@entry.to_s).to_not have_selector("content[type='application/some-format']")
|
101
|
+
let(:entry) { response_xml.elements.to_a("/feed/entry")[5].to_s }
|
102
|
+
it "does not have content embedded" do
|
103
|
+
expect(entry).to_not have_selector("content[type='application/some-format']")
|
119
104
|
end
|
120
105
|
end
|
121
106
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe "catalog/index.html.erb" do
|
5
4
|
|
@@ -13,7 +12,6 @@ describe "catalog/index.html.erb" do
|
|
13
12
|
expect(rendered).to match /id="sidebar"/
|
14
13
|
expect(rendered).to match /id="content"/
|
15
14
|
end
|
16
|
-
|
17
15
|
it "renders the search_sidebar partial" do
|
18
16
|
stub_template "catalog/_search_sidebar.html.erb" => "sidebar_content"
|
19
17
|
render
|
@@ -26,7 +24,6 @@ describe "catalog/index.html.erb" do
|
|
26
24
|
allow(view).to receive(:has_search_parameters?).and_return(true)
|
27
25
|
stub_template "catalog/_results_pagination.html.erb" => ""
|
28
26
|
stub_template "catalog/_search_header.html.erb" => "header_content"
|
29
|
-
|
30
27
|
allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
|
31
28
|
allow(view).to receive(:render_opensearch_response_metadata).and_return("")
|
32
29
|
assign(:response, double(:empty? => true))
|
@@ -1,15 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'spec_helper'
|
3
2
|
|
4
3
|
describe "catalog/show.html.erb" do
|
5
|
-
|
6
|
-
let
|
7
|
-
SolrDocument.new :id => 'xyz', :format => 'a'
|
8
|
-
end
|
9
|
-
|
10
|
-
let :blacklight_config do
|
11
|
-
Blacklight::Configuration.new
|
12
|
-
end
|
4
|
+
let(:document) { SolrDocument.new :id => 'xyz', :format => 'a' }
|
5
|
+
let(:blacklight_config) { Blacklight::Configuration.new }
|
13
6
|
|
14
7
|
before :each do
|
15
8
|
allow(view).to receive(:action_name).and_return('show')
|
@@ -32,7 +25,6 @@ describe "catalog/show.html.erb" do
|
|
32
25
|
allow(view).to receive(:document_show_html_title).and_return("Heading")
|
33
26
|
allow(document).to receive_messages(:itemtype => 'some-item-type-uri')
|
34
27
|
render
|
35
|
-
|
36
28
|
expect(rendered).to have_selector('div#document[@itemscope]')
|
37
29
|
expect(rendered).to have_selector('div#document[@itemtype="some-item-type-uri"]')
|
38
30
|
end
|
@@ -41,14 +33,11 @@ describe "catalog/show.html.erb" do
|
|
41
33
|
allow(view).to receive(:render_grouped_response?).and_return(false)
|
42
34
|
stub_template "catalog/_show_header_default.html.erb" => "document_header"
|
43
35
|
stub_template "catalog/_show_default.html.erb" => "show_default"
|
44
|
-
|
45
36
|
render
|
46
|
-
|
47
37
|
expect(rendered).to match /document_header/
|
48
38
|
expect(rendered).to match /show_default/
|
49
39
|
end
|
50
40
|
|
51
|
-
|
52
41
|
it "uses the show.partials parameter to determine the partials to render" do
|
53
42
|
allow(view).to receive(:render_grouped_response?).and_return(false)
|
54
43
|
blacklight_config.show.partials = ['a', 'b', 'c']
|