blacklight 5.5.1 → 5.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/VERSION +1 -1
  4. data/app/helpers/blacklight/blacklight_helper_behavior.rb +8 -16
  5. data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -1
  6. data/app/helpers/blacklight/facets_helper_behavior.rb +1 -1
  7. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +2 -1
  8. data/app/helpers/blacklight/url_helper_behavior.rb +5 -1
  9. data/app/views/catalog/_view_type_group.html.erb +1 -1
  10. data/blacklight.gemspec +2 -1
  11. data/gemfiles/rails3.gemfile +1 -1
  12. data/gemfiles/rails4.1.gemfile +1 -1
  13. data/gemfiles/rails4.gemfile +1 -1
  14. data/lib/blacklight/catalog.rb +0 -1
  15. data/lib/blacklight/solr/facet_paginator.rb +22 -10
  16. data/lib/generators/blacklight/install_generator.rb +1 -1
  17. data/spec/controllers/bookmarks_controller_spec.rb +6 -6
  18. data/spec/controllers/catalog_controller_spec.rb +48 -48
  19. data/spec/features/alternate_controller_spec.rb +3 -3
  20. data/spec/features/record_view_spec.rb +1 -1
  21. data/spec/features/search_filters_spec.rb +4 -4
  22. data/spec/features/search_results_spec.rb +12 -12
  23. data/spec/helpers/blacklight_helper_spec.rb +83 -83
  24. data/spec/helpers/catalog_helper_spec.rb +37 -37
  25. data/spec/helpers/configuration_helper_spec.rb +39 -39
  26. data/spec/helpers/facets_helper_spec.rb +37 -37
  27. data/spec/helpers/render_constraints_helper_spec.rb +6 -1
  28. data/spec/helpers/search_history_constraints_helper_spec.rb +9 -9
  29. data/spec/helpers/url_helper_spec.rb +49 -39
  30. data/spec/lib/blacklight/configurable_spec.rb +5 -5
  31. data/spec/lib/blacklight/configuration_spec.rb +8 -8
  32. data/spec/lib/blacklight/facet_paginator_spec.rb +25 -0
  33. data/spec/lib/blacklight/routes_spec.rb +4 -4
  34. data/spec/lib/blacklight/search_fields_spec.rb +3 -3
  35. data/spec/lib/blacklight/solr/document_spec.rb +2 -2
  36. data/spec/lib/blacklight/solr_helper_spec.rb +37 -37
  37. data/spec/lib/blacklight/solr_response/group_response_spec.rb +1 -1
  38. data/spec/lib/blacklight/solr_response_spec.rb +31 -31
  39. data/spec/lib/document_presenter_spec.rb +41 -41
  40. data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
  41. data/spec/models/record_mailer_spec.rb +1 -1
  42. data/spec/models/search_spec.rb +1 -1
  43. data/spec/routing/catalog_routing_spec.rb +2 -2
  44. data/spec/spec_helper.rb +1 -0
  45. data/spec/support/include_text.rb +2 -3
  46. data/spec/views/catalog/_constraints.html.erb_spec.rb +7 -7
  47. data/spec/views/catalog/_document.html.erb_spec.rb +4 -4
  48. data/spec/views/catalog/_facet_layout.html.erb_spec.rb +2 -2
  49. data/spec/views/catalog/_facets.html.erb_spec.rb +6 -6
  50. data/spec/views/catalog/_index_default.erb_spec.rb +10 -10
  51. data/spec/views/catalog/_index_header_default.html.erb_spec.rb +5 -5
  52. data/spec/views/catalog/_show_default.erb_spec.rb +10 -10
  53. data/spec/views/catalog/_show_sidebar.erb_spec.rb +5 -5
  54. data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +1 -1
  55. data/spec/views/catalog/_thumbnail_default.erb_spec.rb +4 -4
  56. data/spec/views/catalog/_view_type_group.html.erb_spec.rb +5 -2
  57. data/spec/views/catalog/facet.html.erb_spec.rb +5 -5
  58. data/spec/views/catalog/index.atom.builder_spec.rb +2 -2
  59. data/spec/views/catalog/index.html.erb_spec.rb +5 -5
  60. data/spec/views/catalog/show.html.erb_spec.rb +8 -8
  61. data/tasks/blacklight.rake +1 -2
  62. 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.stub(:blacklight_config).and_return(CatalogController.blacklight_config)
10
- view.stub(:has_user_authentication_provider?).and_return(false)
11
- view.stub(:current_search_session).and_return nil
12
- view.stub(:search_session).and_return({})
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.stub(:more_like_this).and_return([SolrDocument.new({ 'id' => '2', 'title_display' => 'Title of MLT 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.stub(blacklight_config: blacklight_config)
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.stub(:render_grouped_response?).and_return false
22
- view.stub(:blacklight_config).and_return(blacklight_config)
23
- view.stub(:current_search_session).and_return nil
24
- view.stub(:search_session).and_return({})
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.stub(blacklight_config: blacklight_config)
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.stub(:blacklight_config).and_return(blacklight_config)
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.stub(:render_facet_limit)
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.stub(:render_facet_limit)
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.should_receive(:render_facet_limit).with(display_facet, layout: false)
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.stub(:blacklight_config).and_return(@config)
33
- view.stub(:search_field_options_for_select).and_return([])
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.stub(:has_search_parameters?).and_return(false)
8
- view.stub(:blacklight_config).and_return(Blacklight::Configuration.new)
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.stub(:has_search_parameters?).and_return(true)
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.stub(:blacklight_config).and_return(Blacklight::Configuration.new)
30
- view.stub(:render_opensearch_response_metadata).and_return("")
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.stub(:has_user_authentication_provider? => false)
15
- view.stub(:render_document_sidebar_partial => "Sidebar")
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.stub(:blacklight_config).and_return(blacklight_config)
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.stub(:document_show_html_title).and_return("Heading")
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.stub(:document_show_html_title).and_return("Heading")
30
- document.stub(:itemtype => 'some-item-type-uri')
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.stub(:render_grouped_response?).and_return(false)
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.stub(:render_grouped_response?).and_return(false)
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"
@@ -1,4 +1,4 @@
1
- ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.6.0.zip"
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.1
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-08 00:00:00.000000000 Z
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: '2.99'
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: '2.99'
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