blacklight 4.9.0 → 5.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.travis.yml +22 -12
- data/Gemfile +3 -40
- data/LICENSE +1 -2
- data/README.md +1 -2
- data/Rakefile +0 -4
- data/VERSION +1 -1
- data/app/assets/images/blacklight/logo.png +0 -0
- data/app/assets/javascripts/blacklight/ajax_modal.js +190 -0
- data/app/assets/javascripts/blacklight/blacklight.js +7 -17
- data/app/assets/javascripts/blacklight/checkbox_submit.js +1 -1
- data/app/assets/stylesheets/blacklight/{_blacklight_base.scss → _blacklight_base.css.scss} +0 -21
- data/app/assets/stylesheets/blacklight/_bookmark.css.scss +4 -0
- data/app/assets/stylesheets/blacklight/_catalog.css.scss +192 -0
- data/app/assets/stylesheets/blacklight/_facets.css.scss +141 -0
- data/app/assets/stylesheets/blacklight/{_group.scss → _group.css.scss} +1 -1
- data/app/assets/stylesheets/blacklight/_header.css.scss +44 -0
- data/app/assets/stylesheets/blacklight/_layout.css.scss +5 -0
- data/app/assets/stylesheets/blacklight/{_modal.scss → _modal.css.scss} +7 -7
- data/app/assets/stylesheets/blacklight/_search_history.css.scss +20 -0
- data/app/assets/stylesheets/blacklight/{blacklight.scss → blacklight.css.scss} +0 -0
- data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +14 -0
- data/app/controllers/bookmarks_controller.rb +0 -4
- data/app/controllers/feedback_controller.rb +0 -4
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +45 -155
- data/app/helpers/blacklight/catalog_helper_behavior.rb +8 -41
- data/app/helpers/blacklight/facets_helper_behavior.rb +20 -43
- data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +2 -9
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +9 -14
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +6 -6
- data/app/views/_flash_msg.html.erb +9 -2
- data/app/views/_user_util_links.html.erb +29 -15
- data/app/views/bookmarks/_tools.html.erb +4 -7
- data/app/views/bookmarks/index.html.erb +3 -2
- data/app/views/catalog/_citation.html.erb +1 -1
- data/app/views/catalog/_constraints.html.erb +1 -1
- data/app/views/catalog/_constraints_element.html.erb +12 -8
- data/app/views/catalog/_did_you_mean.html.erb +2 -2
- data/app/views/catalog/_document_header.html.erb +3 -3
- data/app/views/catalog/_email_form.html.erb +10 -10
- data/app/views/catalog/_facet_layout.html.erb +11 -3
- data/app/views/catalog/_facet_limit.html.erb +7 -7
- data/app/views/catalog/_facet_pagination.html.erb +8 -7
- data/app/views/catalog/_facet_pivot.html.erb +3 -1
- data/app/views/catalog/_facets.html.erb +12 -9
- data/app/views/catalog/_paginate_compact.html.erb +1 -7
- data/app/views/catalog/_per_page_widget.html.erb +5 -8
- data/app/views/catalog/_previous_next_doc.html.erb +11 -9
- data/app/views/catalog/_refworks_form.html.erb +3 -4
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +16 -14
- data/app/views/catalog/_show_sidebar.html.erb +7 -9
- data/app/views/catalog/_show_tools.html.erb +13 -7
- data/app/views/catalog/_sms_form.html.erb +8 -8
- data/app/views/catalog/_sort_and_per_page.html.erb +4 -6
- data/app/views/catalog/_sort_widget.html.erb +5 -6
- data/app/views/catalog/email.html.erb +1 -1
- data/app/views/catalog/facet.html.erb +2 -8
- data/app/views/catalog/index.html.erb +11 -6
- data/app/views/catalog/show.html.erb +5 -5
- data/app/views/catalog/sms.html.erb +1 -1
- data/app/views/catalog/sms_sent.html.erb +1 -1
- data/app/views/feedback/complete.html.erb +2 -2
- data/app/views/feedback/show.html.erb +1 -1
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -1
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +25 -5
- data/app/views/layouts/blacklight.html.erb +23 -23
- data/app/views/saved_searches/index.html.erb +2 -2
- data/app/views/search_history/index.html.erb +5 -7
- data/app/views/shared/_header_navbar.html.erb +23 -23
- data/blacklight.gemspec +10 -13
- data/config/locales/blacklight.en.yml +1 -12
- data/config/locales/blacklight.fr.yml +1 -12
- data/gemfiles/rails3.gemfile +21 -0
- data/gemfiles/rails4.gemfile +20 -0
- data/lib/blacklight.rb +0 -8
- data/lib/blacklight/base.rb +0 -2
- data/lib/blacklight/catalog.rb +6 -32
- data/lib/blacklight/catalog/search_context.rb +8 -48
- data/lib/blacklight/configurable.rb +2 -1
- data/lib/blacklight/configuration.rb +1 -2
- data/lib/blacklight/configuration/facet_field.rb +0 -2
- data/lib/blacklight/engine.rb +3 -3
- data/lib/blacklight/legacy_controller_methods.rb +1 -64
- data/lib/blacklight/rails/routes.rb +17 -0
- data/lib/blacklight/routes.rb +46 -40
- data/lib/blacklight/solr.rb +1 -0
- data/lib/blacklight/solr/document.rb +21 -42
- data/lib/blacklight/solr/facet_paginator.rb +30 -54
- data/lib/blacklight/solr/request.rb +45 -0
- data/lib/blacklight/solr_helper.rb +16 -53
- data/lib/blacklight/solr_response.rb +0 -6
- data/lib/blacklight/user.rb +2 -7
- data/lib/blacklight/utils.rb +1 -9
- data/lib/generators/blacklight/assets_generator.rb +0 -14
- data/lib/generators/blacklight/blacklight_generator.rb +17 -14
- data/lib/generators/blacklight/templates/blacklight.css.scss +3 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +4 -1
- data/lib/railties/blacklight.rake +3 -1
- data/solr/sample_solr_documents.yml +641 -0
- data/spec/controllers/application_controller_spec.rb +5 -21
- data/spec/controllers/bookmarks_controller_spec.rb +11 -11
- data/spec/controllers/catalog_controller_spec.rb +122 -119
- data/spec/controllers/search_history_controller_spec.rb +8 -8
- data/spec/features/alternate_controller_spec.rb +5 -5
- data/spec/features/facets_spec.rb +9 -0
- data/spec/features/record_view_spec.rb +1 -1
- data/spec/features/search_filters_spec.rb +97 -41
- data/spec/features/search_results_spec.rb +14 -17
- data/spec/features/search_sort_spec.rb +1 -1
- data/spec/helpers/blacklight_helper_spec.rb +170 -285
- data/spec/helpers/catalog_helper_spec.rb +57 -96
- data/spec/helpers/facets_helper_spec.rb +130 -152
- data/spec/helpers/hash_as_hidden_fields_spec.rb +9 -15
- data/spec/helpers/render_constraints_helper_spec.rb +5 -5
- data/spec/helpers/search_history_constraints_helper_spec.rb +21 -21
- data/spec/lib/blacklight/routes_spec.rb +25 -0
- data/spec/lib/blacklight/solr/request_spec.rb +37 -0
- data/spec/lib/blacklight/solr_response/group_response_spec.rb +2 -2
- data/spec/lib/blacklight_configurable_spec.rb +16 -16
- data/spec/lib/blacklight_configuration_spec.rb +132 -132
- data/spec/lib/blacklight_email_spec.rb +4 -4
- data/spec/lib/blacklight_sms_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_dublin_core_spec.rb +6 -6
- data/spec/lib/blacklight_solr_document_more_like_this_spec.rb +4 -4
- data/spec/lib/blacklight_solr_document_spec.rb +36 -36
- data/spec/lib/blacklight_solr_response_spec.rb +43 -48
- data/spec/lib/blacklight_spec.rb +6 -14
- data/spec/lib/blacklight_user_spec.rb +5 -9
- data/spec/lib/facet_paginator_spec.rb +59 -51
- data/spec/lib/search_fields_spec.rb +13 -13
- data/spec/lib/solr_helper_spec.rb +258 -304
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
- data/spec/lib/utils_spec.rb +16 -46
- data/spec/models/bookmark_spec.rb +6 -7
- data/spec/models/record_mailer_spec.rb +16 -16
- data/spec/models/search_spec.rb +8 -8
- data/spec/models/solr_document_spec.rb +6 -77
- data/spec/routing/catalog_routing_spec.rb +16 -10
- data/spec/spec_helper.rb +7 -7
- data/spec/support/assert_difference.rb +2 -2
- data/spec/support/features.rb +0 -11
- data/spec/support/features/session_helpers.rb +3 -3
- data/spec/support/include_text.rb +2 -2
- data/spec/test_app_templates/Gemfile.extra +10 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +12 -18
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +13 -13
- data/spec/views/catalog/_document.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facets.html.erb_spec.rb +13 -14
- data/spec/views/catalog/_index_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_search_header.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_default.erb_spec.rb +21 -21
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +7 -7
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +3 -3
- data/spec/views/catalog/index.atom.builder_spec.rb +29 -29
- data/spec/views/catalog/index.html.erb_spec.rb +6 -7
- data/tasks/blacklight.rake +8 -2
- metadata +84 -180
- data/app/assets/javascripts/blacklight/css_dropdowns.js +0 -10
- data/app/assets/javascripts/blacklight/facet_expand_contract.js +0 -41
- data/app/assets/javascripts/blacklight/lightbox_dialog.js +0 -70
- data/app/assets/javascripts/blacklight/select_submit.js +0 -27
- data/app/assets/javascripts/blacklight/zebra_stripe.js +0 -13
- data/app/assets/javascripts/improved-modal/bootstrap-modal.js +0 -355
- data/app/assets/javascripts/improved-modal/bootstrap-modalmanager.js +0 -370
- data/app/assets/stylesheets/blacklight/_bookmark.scss +0 -33
- data/app/assets/stylesheets/blacklight/_catalog.scss +0 -255
- data/app/assets/stylesheets/blacklight/_dropdown.scss +0 -57
- data/app/assets/stylesheets/blacklight/_facets.scss +0 -197
- data/app/assets/stylesheets/blacklight/_footer.scss +0 -0
- data/app/assets/stylesheets/blacklight/_header.scss +0 -53
- data/app/assets/stylesheets/blacklight/_layout.scss +0 -10
- data/app/assets/stylesheets/blacklight/_mixins.scss +0 -0
- data/app/assets/stylesheets/blacklight/_print.scss +0 -0
- data/app/assets/stylesheets/blacklight/_responsive.scss +0 -3
- data/app/assets/stylesheets/blacklight/_search_history.scss +0 -42
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +0 -49
- data/app/assets/stylesheets/blacklight/responsive_partials/_catalog.scss +0 -5
- data/app/assets/stylesheets/blacklight/responsive_partials/_facets.scss +0 -37
- data/app/assets/stylesheets/blacklight/responsive_partials/_header.scss +0 -30
- data/app/assets/stylesheets/improved-modal/bootstrap-modal.css +0 -217
- data/app/helpers/blacklight/html_head_helper_behavior.rb +0 -118
- data/app/helpers/html_head_helper.rb +0 -3
- data/app/views/catalog/_bookmark_form.html.erb +0 -7
- data/app/views/catalog/_marc_view.html.erb +0 -32
- data/app/views/catalog/librarian_view.html.erb +0 -10
- data/config/routes.rb +0 -17
- data/doc/Atom-Responses.md +0 -90
- data/doc/Blacklight-3.0-Release-Notes-And-Upgrade-Guide.md +0 -107
- data/doc/Blacklight-3.2-Release-Notes-and-Upgrade-Guide.md +0 -191
- data/doc/Blacklight-3.3-release-notes-and-upgrade-guide.md +0 -37
- data/doc/Blacklight-3.4-release-notes-and-upgrade-guide.md +0 -27
- data/doc/Blacklight-3.5-release-notes-and-upgrade-guide.md +0 -44
- data/doc/Blacklight-3.6-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-3.7-release-notes-and-upgrade-guide.md +0 -80
- data/doc/Blacklight-3.8-release-notes-and-upgrade-guide.md +0 -11
- data/doc/Blacklight-4.0-release-notes-and-upgrade-guide.md +0 -135
- data/doc/Blacklight-4.1-release-notes-and-upgrade-guide.md +0 -17
- data/doc/Blacklight-4.2-release-notes-and-upgrade-guide.md +0 -25
- data/doc/Blacklight-4.3-release-notes-and-upgrade-guide.md +0 -21
- data/doc/Blacklight-4.4-release-notes-and-upgrade-guide.md +0 -41
- data/doc/Blacklight-Add-ons.md +0 -28
- data/doc/Blacklight-configuration.md +0 -411
- data/doc/Blacklight-on-Heroku.md +0 -135
- data/doc/Code4Lib-2014.md +0 -48
- data/doc/Community-principles.md +0 -44
- data/doc/Configuring-and-Customizing-Blacklight.md +0 -271
- data/doc/Configuring-rails-routes.md +0 -13
- data/doc/Contributing-to-Blacklight.md +0 -25
- data/doc/Examples.md +0 -94
- data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -141
- data/doc/FAQs.md +0 -1
- data/doc/Home.md +0 -80
- data/doc/How-to-release-a-version.md +0 -29
- data/doc/Indexing-your-data-into-solr.md +0 -32
- data/doc/Integration-with-Rails-Footnotes.md +0 -20
- data/doc/Internationalization.md +0 -32
- data/doc/JSON-API.md +0 -17
- data/doc/Pagination.md +0 -51
- data/doc/Providing-your-own-view-templates.md +0 -109
- data/doc/Quickstart.md +0 -115
- data/doc/README_SOLR.md +0 -245
- data/doc/Release-Notes-And-Upgrade-Guides.md +0 -20
- data/doc/Roadmap.md +0 -43
- data/doc/Sunspot-for-indexing.md +0 -46
- data/doc/Theming.md +0 -64
- data/doc/User-Authentication.md +0 -60
- data/doc/testing.md +0 -57
- data/lib/SolrMarc.jar +0 -0
- data/lib/blacklight/mash.rb +0 -19
- data/lib/blacklight/solr/document/marc.rb +0 -71
- data/lib/blacklight/solr/document/marc_export.rb +0 -590
- data/lib/generators/blacklight/marc_generator.rb +0 -66
- data/lib/generators/blacklight/templates/blacklight.scss +0 -4
- data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/config.properties +0 -37
- data/lib/generators/blacklight/templates/config/SolrMarc/index.properties +0 -97
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/dewey.bsh +0 -47
- data/lib/generators/blacklight/templates/config/SolrMarc/index_scripts/format.bsh +0 -126
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/README_MAPS +0 -1
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/callnumber_map.properties +0 -407
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/composition_era_map.properties +0 -56
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/country_map.properties +0 -379
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/format_map.properties +0 -50
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/instrument_map.properties +0 -101
- data/lib/generators/blacklight/templates/config/SolrMarc/translation_maps/language_map.properties +0 -490
- data/lib/railties/solr_marc.rake +0 -162
- data/spec/data/test_data.utf8.mrc +0 -1
- data/spec/features/librarian_view_spec.rb +0 -13
- data/spec/helpers/html_head_helper_spec.rb +0 -164
- data/spec/lib/blacklight_solr_document_marc_spec.rb +0 -89
- data/spec/lib/marc_export_spec.rb +0 -746
- data/spec/lib/tasks/solr_marc_task_spec.rb +0 -60
- data/spec/requests/alternate_controller_spec.rb +0 -16
- data/spec/routing/routes_spec.rb +0 -20
- data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +0 -49
- data/test_support/data/test_data.utf8.mrc +0 -1
@@ -1,30 +1,14 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require
|
2
|
+
require 'spec_helper'
|
3
|
+
|
3
4
|
describe ApplicationController do
|
4
5
|
include Devise::TestHelpers
|
5
6
|
|
6
|
-
#
|
7
|
-
describe "head content from variables" do
|
8
|
-
|
9
|
-
describe "#default_html_head" do
|
10
|
-
it "should setup js and css defaults" do
|
11
|
-
Deprecation.silence(Blacklight::LegacyControllerMethods) do
|
12
|
-
controller.send(:default_html_head)
|
13
|
-
|
14
|
-
# by default, these should be empty, but left in for backwards compatibility
|
15
|
-
expect(controller.javascript_includes).to be_empty
|
16
|
-
expect(controller.stylesheet_links).to be_empty
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "#blacklight_config" do
|
7
|
+
describe "#blacklight_config" do
|
22
8
|
|
23
|
-
|
24
|
-
|
25
|
-
end
|
9
|
+
it "should provide a default blacklight_config everywhere" do
|
10
|
+
controller.blacklight_config.should == CatalogController.blacklight_config
|
26
11
|
end
|
27
|
-
|
28
12
|
end
|
29
13
|
|
30
14
|
end
|
@@ -8,34 +8,34 @@ describe BookmarksController do
|
|
8
8
|
describe "update" do
|
9
9
|
it "has a 204 status code when creating a new one" do
|
10
10
|
xhr :put, :update, :id => '2007020969', :format => :js
|
11
|
-
|
12
|
-
|
11
|
+
response.should be_success
|
12
|
+
response.code.should == "204"
|
13
13
|
end
|
14
14
|
|
15
15
|
it "has a 500 status code when fails is success" do
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
@controller.stub_chain(:current_or_guest_user, :existing_bookmark_for).and_return(false)
|
17
|
+
@controller.stub_chain(:current_or_guest_user, :persisted?).and_return(true)
|
18
|
+
@controller.stub_chain(:current_or_guest_user, :bookmarks, :create).and_return(false)
|
19
19
|
xhr :put, :update, :id => 'iamabooboo', :format => :js
|
20
|
-
|
20
|
+
response.code.should == "500"
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
describe "delete" do
|
25
25
|
it "has a 204 status code when delete is success" do
|
26
26
|
xhr :delete, :destroy, :id => '2007020969', :format => :js
|
27
|
-
|
28
|
-
|
27
|
+
response.should be_success
|
28
|
+
response.code.should == "204"
|
29
29
|
end
|
30
30
|
|
31
31
|
it "has a 500 status code when delete is not success" do
|
32
32
|
bm = double(Bookmark)
|
33
|
-
|
34
|
-
|
33
|
+
@controller.stub_chain(:current_or_guest_user, :existing_bookmark_for).and_return(bm)
|
34
|
+
@controller.stub_chain(:current_or_guest_user, :bookmarks, :delete).and_return(false)
|
35
35
|
|
36
36
|
xhr :delete, :destroy, :id => 'pleasekillme', :format => :js
|
37
37
|
#
|
38
|
-
|
38
|
+
response.code.should == "500"
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
3
|
-
require 'rubygems'
|
4
|
-
require 'marc'
|
5
3
|
|
6
4
|
describe CatalogController do
|
7
5
|
include Devise::TestHelpers
|
@@ -23,68 +21,68 @@ describe CatalogController do
|
|
23
21
|
|
24
22
|
describe "with format :html" do
|
25
23
|
it "should have no search history if no search criteria" do
|
26
|
-
|
24
|
+
controller.should_receive(:get_search_results)
|
27
25
|
session[:history] = []
|
28
26
|
get :index
|
29
|
-
|
27
|
+
session[:history].length.should == 0
|
30
28
|
end
|
31
29
|
|
32
30
|
# check each user manipulated parameter
|
33
31
|
it "should have docs and facets for query with results", :integration => true do
|
34
32
|
get :index, :q => @user_query
|
35
|
-
|
33
|
+
assigns_response.docs.size.should > 1
|
36
34
|
assert_facets_have_values(assigns_response.facets)
|
37
35
|
end
|
38
36
|
it "should have docs and facets for existing facet value", :integration => true do
|
39
37
|
get :index, :f => @facet_query
|
40
|
-
|
38
|
+
assigns_response.docs.size.should > 1
|
41
39
|
assert_facets_have_values(assigns_response.facets)
|
42
40
|
end
|
43
41
|
it "should have docs and facets for non-default results per page", :integration => true do
|
44
42
|
num_per_page = 7
|
45
43
|
get :index, :per_page => num_per_page
|
46
|
-
|
44
|
+
assigns_response.docs.size.should == num_per_page
|
47
45
|
assert_facets_have_values(assigns_response.facets)
|
48
46
|
end
|
49
47
|
|
50
48
|
it "should have docs and facets for second page", :integration => true do
|
51
49
|
page = 2
|
52
50
|
get :index, :page => page
|
53
|
-
|
54
|
-
|
51
|
+
assigns_response.docs.size.should > 1
|
52
|
+
assigns_response.params[:start].to_i.should == (page-1) * @controller.blacklight_config[:default_solr_params][:rows]
|
55
53
|
assert_facets_have_values(assigns_response.facets)
|
56
54
|
end
|
57
55
|
|
58
56
|
it "should have no docs or facet values for query without results", :integration => true do
|
59
57
|
get :index, :q => @no_docs_query
|
60
58
|
|
61
|
-
|
59
|
+
assigns_response.docs.size.should == 0
|
62
60
|
assigns_response.facets.each do |facet|
|
63
|
-
|
61
|
+
facet.items.size.should == 0
|
64
62
|
end
|
65
63
|
end
|
66
64
|
|
67
65
|
it "should have a spelling suggestion for an appropriately poor query", :integration => true do
|
68
66
|
get :index, :q => 'boo'
|
69
|
-
|
67
|
+
assigns_response.spelling.words.should_not be_nil
|
70
68
|
end
|
71
69
|
|
72
70
|
describe "session" do
|
73
71
|
before do
|
74
|
-
|
72
|
+
controller.stub(:get_search_results)
|
75
73
|
end
|
76
74
|
it "should include :search key with hash" do
|
77
75
|
get :index
|
78
|
-
|
79
|
-
|
76
|
+
session[:search].should_not be_nil
|
77
|
+
session[:search].should be_kind_of(Hash)
|
80
78
|
end
|
81
79
|
it "should include search hash with key :q" do
|
82
80
|
get :index, :q => @user_query
|
83
|
-
|
84
|
-
|
81
|
+
session[:search].should_not be_nil
|
82
|
+
session[:search].keys.should include(:id)
|
85
83
|
|
86
|
-
search = Search.find(session[:search][
|
87
|
-
expect(search.query_params[
|
84
|
+
search = Search.find(session[:search][:id])
|
85
|
+
expect(search.query_params[:q]).to eq @user_query
|
88
86
|
end
|
89
87
|
end
|
90
88
|
|
@@ -92,7 +90,7 @@ describe CatalogController do
|
|
92
90
|
describe "for default query" do
|
93
91
|
it "should get documents when no query", :integration => true do
|
94
92
|
get :index
|
95
|
-
|
93
|
+
assigns_response.docs.size.should > 1
|
96
94
|
end
|
97
95
|
it "should get facets when no query", :integration => true do
|
98
96
|
get :index
|
@@ -101,29 +99,29 @@ describe CatalogController do
|
|
101
99
|
end
|
102
100
|
|
103
101
|
it "should render index.html.erb" do
|
104
|
-
|
102
|
+
controller.stub(:get_search_results)
|
105
103
|
get :index
|
106
|
-
|
104
|
+
response.should render_template(:index)
|
107
105
|
end
|
108
106
|
|
109
107
|
# NOTE: status code is always 200 in isolation mode ...
|
110
108
|
it "HTTP status code for GET should be 200", :integration => true do
|
111
109
|
get :index
|
112
|
-
|
110
|
+
response.should be_success
|
113
111
|
end
|
114
112
|
end
|
115
113
|
|
116
114
|
describe "with format :rss" do
|
117
115
|
it "should get the feed", :integration => true do
|
118
116
|
get :index, :format => 'rss'
|
119
|
-
|
117
|
+
response.should be_success
|
120
118
|
end
|
121
119
|
end
|
122
120
|
|
123
121
|
describe "with format :json" do
|
124
122
|
before do
|
125
123
|
get :index, :format => 'json'
|
126
|
-
|
124
|
+
response.should be_success
|
127
125
|
end
|
128
126
|
let(:json) { JSON.parse(response.body)['response'] }
|
129
127
|
let(:pages) { json["pages"] }
|
@@ -131,29 +129,29 @@ describe CatalogController do
|
|
131
129
|
let(:facets) { json["facets"] }
|
132
130
|
|
133
131
|
it "should get the pages" do
|
134
|
-
|
135
|
-
|
136
|
-
|
132
|
+
pages["total_count"].should == 30
|
133
|
+
pages["current_page"].should == 1
|
134
|
+
pages["total_pages"].should == 3
|
137
135
|
end
|
138
136
|
|
139
137
|
it "should get the documents" do
|
140
|
-
|
138
|
+
docs.size.should == 10
|
141
139
|
expect(docs.first.keys).to match_array(["published_display", "author_display", "lc_callnum_display", "pub_date", "subtitle_display", "format", "material_type_display", "title_display", "id", "subject_topic_facet", "language_facet", "score"])
|
142
140
|
end
|
143
141
|
|
144
142
|
it "should get the facets" do
|
145
|
-
|
146
|
-
|
143
|
+
facets.length.should == 9
|
144
|
+
facets.first.should == {"name"=>"format", "label" => "Format", "items"=>[{"value"=>"Book", "hits"=>30, "label"=>"Book"}]}
|
147
145
|
end
|
148
146
|
|
149
147
|
describe "facets" do
|
150
148
|
let(:query_facet_items) { facets.last['items'] }
|
151
149
|
let(:regular_facet_items) { facets.first['items'] }
|
152
150
|
it "should have items with labels and values" do
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
151
|
+
query_facet_items.first['label'].should == 'within 10 Years'
|
152
|
+
query_facet_items.first['value'].should == 'years_10'
|
153
|
+
regular_facet_items.first['label'].should == "Book"
|
154
|
+
regular_facet_items.first['value'].should == "Book"
|
157
155
|
end
|
158
156
|
end
|
159
157
|
end
|
@@ -165,13 +163,18 @@ describe CatalogController do
|
|
165
163
|
|
166
164
|
it "should set counter value into session[:search]" do
|
167
165
|
put :update, :id => doc_id, :counter => 3
|
168
|
-
|
166
|
+
session[:search][:counter].should == "3"
|
169
167
|
end
|
170
168
|
|
171
169
|
it "should redirect to show action for doc id" do
|
172
170
|
put :update, :id => doc_id, :counter => 3
|
173
171
|
assert_redirected_to(catalog_path(doc_id))
|
174
172
|
end
|
173
|
+
|
174
|
+
it "HTTP status code for redirect should be 303" do
|
175
|
+
put :update, :id => doc_id, :counter => 3
|
176
|
+
response.status.should == 303
|
177
|
+
end
|
175
178
|
end
|
176
179
|
|
177
180
|
# SHOW ACTION
|
@@ -182,14 +185,14 @@ describe CatalogController do
|
|
182
185
|
describe "with format :html" do
|
183
186
|
it "should get document", :integration => true do
|
184
187
|
get :show, :id => doc_id
|
185
|
-
|
188
|
+
assigns[:document].should_not be_nil
|
186
189
|
end
|
187
190
|
end
|
188
191
|
|
189
192
|
describe "with format :json" do
|
190
193
|
it "should get the feed" do
|
191
194
|
get :show, id: doc_id, format: 'json'
|
192
|
-
|
195
|
+
response.should be_success
|
193
196
|
json = JSON.parse response.body
|
194
197
|
expect(json["response"]["document"].keys).to match_array(["author_t", "opensearch_display", "marc_display", "published_display", "author_display", "lc_callnum_display", "title_t", "pub_date", "pub_date_sort", "subtitle_display", "format", "url_suppl_display", "material_type_display", "title_display", "subject_addl_t", "subject_t", "isbn_t", "id", "title_addl_t", "subject_geo_facet", "subject_topic_facet", "author_addl_t", "language_facet", "subtitle_t", "timestamp"])
|
195
198
|
end
|
@@ -199,59 +202,59 @@ describe CatalogController do
|
|
199
202
|
before do
|
200
203
|
@mock_response = double()
|
201
204
|
@mock_document = double()
|
202
|
-
|
203
|
-
|
205
|
+
@mock_document.stub(:export_formats => {})
|
206
|
+
controller.stub(:get_solr_response_for_doc_id => [@mock_response, @mock_document],
|
204
207
|
:get_previous_and_next_documents_for_search => [double(:total => 5), [double("a"), @mock_document, double("b")]])
|
205
208
|
|
206
209
|
current_search = Search.create(:query_params => { :q => ""})
|
207
|
-
|
210
|
+
controller.stub(:current_search_session => current_search)
|
208
211
|
|
209
212
|
@search_session = { :id => current_search.id }
|
210
213
|
end
|
211
214
|
it "should set previous document if counter present in session" do
|
212
|
-
session[:search] = @search_session.merge(
|
215
|
+
session[:search] = @search_session.merge(:counter => 2)
|
213
216
|
get :show, :id => doc_id
|
214
|
-
|
217
|
+
assigns[:previous_document].should_not be_nil
|
215
218
|
end
|
216
219
|
it "should not set previous or next document if session is blank" do
|
217
220
|
get :show, :id => doc_id
|
218
|
-
|
219
|
-
|
221
|
+
assigns[:previous_document].should be_nil
|
222
|
+
assigns[:next_document].should be_nil
|
220
223
|
end
|
221
|
-
it "should not set previous or next document if session[:search][
|
224
|
+
it "should not set previous or next document if session[:search][:counter] is nil" do
|
222
225
|
session[:search] = {}
|
223
226
|
get :show, :id => doc_id
|
224
|
-
|
225
|
-
|
227
|
+
assigns[:previous_document].should be_nil
|
228
|
+
assigns[:next_document].should be_nil
|
226
229
|
end
|
227
230
|
it "should set next document if counter present in session" do
|
228
|
-
session[:search] = @search_session.merge(
|
231
|
+
session[:search] = @search_session.merge(:counter => 2)
|
229
232
|
get :show, :id => doc_id
|
230
|
-
|
233
|
+
assigns[:next_document].should_not be_nil
|
231
234
|
end
|
232
235
|
end
|
233
236
|
|
234
237
|
# NOTE: status code is always 200 in isolation mode ...
|
235
238
|
it "HTTP status code for GET should be 200", :integration => true do
|
236
239
|
get :show, :id => doc_id
|
237
|
-
|
240
|
+
response.should be_success
|
238
241
|
end
|
239
242
|
it "should render show.html.erb" do
|
240
243
|
@mock_response = double()
|
241
244
|
@mock_document = double()
|
242
|
-
|
243
|
-
|
245
|
+
@mock_document.stub(:export_formats => {})
|
246
|
+
controller.stub(:get_solr_response_for_doc_id => [@mock_response, @mock_document],
|
244
247
|
:get_single_doc_via_search => @mock_document)
|
245
248
|
get :show, :id => doc_id
|
246
|
-
|
249
|
+
response.should render_template(:show)
|
247
250
|
end
|
248
251
|
|
249
252
|
describe "@document" do
|
250
253
|
before do
|
251
254
|
@mock_response = double()
|
252
|
-
|
255
|
+
@mock_response.stub(:docs => [{ :id => 'my_fake_doc' }])
|
253
256
|
@mock_document = double()
|
254
|
-
|
257
|
+
controller.stub(:find => @mock_response,
|
255
258
|
:get_single_doc_via_search => @mock_document)
|
256
259
|
end
|
257
260
|
before(:each) do
|
@@ -259,7 +262,7 @@ describe CatalogController do
|
|
259
262
|
@document = assigns[:document]
|
260
263
|
end
|
261
264
|
it "should be a SolrDocument" do
|
262
|
-
|
265
|
+
@document.should be_instance_of(SolrDocument)
|
263
266
|
end
|
264
267
|
end
|
265
268
|
|
@@ -276,12 +279,12 @@ describe CatalogController do
|
|
276
279
|
end
|
277
280
|
before do
|
278
281
|
@mock_response = double()
|
279
|
-
|
282
|
+
@mock_response.stub(:docs => [{ :id => 'my_fake_doc' }])
|
280
283
|
@mock_document = double()
|
281
|
-
|
284
|
+
controller.stub(:find => @mock_response,
|
282
285
|
:get_single_doc_via_search => @mock_document)
|
283
286
|
|
284
|
-
|
287
|
+
controller.stub(:find => @mock_response,
|
285
288
|
:get_single_doc_via_search => @mock_document)
|
286
289
|
end
|
287
290
|
|
@@ -299,8 +302,8 @@ describe CatalogController do
|
|
299
302
|
|
300
303
|
it "should respond to an extension-registered format properly" do
|
301
304
|
get :show, :id => doc_id, :format => "mock" # This no longer works: :format => "mock"
|
302
|
-
|
303
|
-
|
305
|
+
response.should be_success
|
306
|
+
response.body.should =~ /mock_export/
|
304
307
|
end
|
305
308
|
|
306
309
|
|
@@ -316,18 +319,18 @@ describe CatalogController do
|
|
316
319
|
before do
|
317
320
|
@mock_response = double()
|
318
321
|
@mock_document = double()
|
319
|
-
|
322
|
+
@mock_response.stub(:docs => [{ :id => 'my_fake_doc' }, { :id => 'my_other_doc'}])
|
320
323
|
@mock_document = double()
|
321
|
-
|
324
|
+
controller.stub(:find => @mock_response,
|
322
325
|
:get_single_doc_via_search => @mock_document)
|
323
326
|
end
|
324
327
|
it "should return an opensearch description" do
|
325
328
|
get :opensearch, :format => 'xml'
|
326
|
-
|
329
|
+
response.should be_success
|
327
330
|
end
|
328
331
|
it "should return valid JSON" do
|
329
332
|
get :opensearch,:format => 'json', :q => "a"
|
330
|
-
|
333
|
+
response.should be_success
|
331
334
|
end
|
332
335
|
end
|
333
336
|
#=end
|
@@ -336,9 +339,9 @@ describe CatalogController do
|
|
336
339
|
before do
|
337
340
|
@mock_response = double()
|
338
341
|
@mock_document = double()
|
339
|
-
|
342
|
+
@mock_response.stub(:docs => [{ :id => 'my_fake_doc' }, { :id => 'my_other_doc'}])
|
340
343
|
@mock_document = double()
|
341
|
-
|
344
|
+
controller.stub(:find => @mock_response,
|
342
345
|
:get_single_doc_via_search => @mock_document)
|
343
346
|
end
|
344
347
|
before(:each) do
|
@@ -349,24 +352,24 @@ describe CatalogController do
|
|
349
352
|
describe "email" do
|
350
353
|
it "should give error if no TO paramater" do
|
351
354
|
post :email, :id => doc_id
|
352
|
-
|
355
|
+
request.flash[:error].should == "You must enter a recipient in order to send this message"
|
353
356
|
end
|
354
357
|
it "should give an error if the email address is not valid" do
|
355
358
|
post :email, :id => doc_id, :to => 'test_bad_email'
|
356
|
-
|
359
|
+
request.flash[:error].should == "You must enter a valid email address"
|
357
360
|
end
|
358
361
|
it "should not give error if no Message paramater is set" do
|
359
362
|
post :email, :id => doc_id, :to => 'test_email@projectblacklight.org'
|
360
|
-
|
363
|
+
request.flash[:error].should be_nil
|
361
364
|
end
|
362
365
|
it "should redirect back to the record upon success" do
|
363
366
|
mock_mailer = double
|
364
|
-
|
365
|
-
|
367
|
+
mock_mailer.should_receive(:deliver)
|
368
|
+
RecordMailer.should_receive(:email_record).with(anything, { :to => 'test_email@projectblacklight.org', :message => 'xyz' }, hash_including(:host => 'test.host')).and_return mock_mailer
|
366
369
|
|
367
370
|
post :email, :id => doc_id, :to => 'test_email@projectblacklight.org', :message => 'xyz'
|
368
|
-
|
369
|
-
|
371
|
+
request.flash[:error].should be_nil
|
372
|
+
request.should redirect_to(catalog_path(doc_id))
|
370
373
|
end
|
371
374
|
|
372
375
|
it "should render email_sent for XHR requests" do
|
@@ -378,29 +381,29 @@ describe CatalogController do
|
|
378
381
|
describe "sms" do
|
379
382
|
it "should give error if no phone number is given" do
|
380
383
|
post :sms, :id => doc_id, :carrier => 'att'
|
381
|
-
|
384
|
+
request.flash[:error].should == "You must enter a recipient's phone number in order to send this message"
|
382
385
|
end
|
383
386
|
it "should give an error when a carrier is not provided" do
|
384
387
|
post :sms, :id => doc_id, :to => '5555555555', :carrier => ''
|
385
|
-
|
388
|
+
request.flash[:error].should == "You must select a carrier"
|
386
389
|
end
|
387
390
|
it "should give an error when the phone number is not 10 digits" do
|
388
391
|
post :sms, :id => doc_id, :to => '555555555', :carrier => 'txt.att.net'
|
389
|
-
|
392
|
+
request.flash[:error].should == "You must enter a valid 10 digit phone number"
|
390
393
|
end
|
391
394
|
it "should give an error when the carrier is not in our list of carriers" do
|
392
395
|
post :sms, :id => doc_id, :to => '5555555555', :carrier => 'no-such-carrier'
|
393
|
-
|
396
|
+
request.flash[:error].should == "You must enter a valid carrier"
|
394
397
|
end
|
395
398
|
it "should allow punctuation in phone number" do
|
396
399
|
post :sms, :id => doc_id, :to => '(555) 555-5555', :carrier => 'txt.att.net'
|
397
|
-
|
398
|
-
|
400
|
+
request.flash[:error].should be_nil
|
401
|
+
request.should redirect_to(catalog_path(doc_id))
|
399
402
|
end
|
400
403
|
it "should redirect back to the record upon success" do
|
401
404
|
post :sms, :id => doc_id, :to => '5555555555', :carrier => 'txt.att.net'
|
402
|
-
|
403
|
-
|
405
|
+
request.flash[:error].should be_nil
|
406
|
+
request.should redirect_to(catalog_path(doc_id))
|
404
407
|
end
|
405
408
|
|
406
409
|
it "should render sms_sent template for XHR requests" do
|
@@ -414,36 +417,36 @@ describe CatalogController do
|
|
414
417
|
describe "errors" do
|
415
418
|
it "should return status 404 for a record that doesn't exist" do
|
416
419
|
@mock_response = double()
|
417
|
-
|
420
|
+
@mock_response.stub(:docs => [])
|
418
421
|
@mock_document = double()
|
419
|
-
|
422
|
+
controller.stub(:find => @mock_response,
|
420
423
|
:get_single_doc_via_search => @mock_document)
|
421
424
|
get :show, :id=>"987654321"
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
+
request.flash[:notice].should == "Sorry, you have requested a record that doesn't exist."
|
426
|
+
response.should render_template('index')
|
427
|
+
response.status.should == 404
|
425
428
|
end
|
426
429
|
it "should redirect the user to the root url for a bad search" do
|
427
430
|
req = {}
|
428
431
|
res = {}
|
429
432
|
fake_error = RSolr::Error::Http.new(req, res)
|
430
|
-
|
431
|
-
|
433
|
+
controller.stub(:get_search_results) { |*args| raise fake_error }
|
434
|
+
controller.logger.should_receive(:error).with(fake_error)
|
432
435
|
get :index, :q=>"+"
|
433
436
|
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
437
|
+
response.redirect_url.should == root_url
|
438
|
+
request.flash[:notice].should == "Sorry, I don't understand your search."
|
439
|
+
response.should_not be_success
|
440
|
+
response.status.should == 302
|
438
441
|
end
|
439
442
|
it "should return status 500 if the catalog path is raising an exception" do
|
440
443
|
|
441
444
|
req = {}
|
442
445
|
res = {}
|
443
446
|
fake_error = RSolr::Error::Http.new(req, res)
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
+
controller.stub(:get_search_results) { |*args| raise fake_error }
|
448
|
+
controller.flash.stub(:sweep)
|
449
|
+
controller.stub(:flash).and_return(:notice => I18n.t('blacklight.search.errors.request_error'))
|
447
450
|
expect {
|
448
451
|
get :index, :q=>"+"
|
449
452
|
}.to raise_error
|
@@ -455,18 +458,18 @@ describe CatalogController do
|
|
455
458
|
render_views
|
456
459
|
|
457
460
|
before do
|
458
|
-
|
461
|
+
controller.stub(:has_user_authentication_provider?) { false }
|
459
462
|
@mock_response = double()
|
460
463
|
@mock_document = double()
|
461
|
-
|
464
|
+
@mock_response.stub(:docs => [], :total => 1, :facets => [], :facet_queries => {}, :facet_by_field_name => nil)
|
462
465
|
@mock_document = double()
|
463
|
-
|
466
|
+
controller.stub(:find => @mock_response,
|
464
467
|
:get_single_doc_via_search => @mock_document)
|
465
468
|
end
|
466
469
|
|
467
470
|
it "should not show user util links" do
|
468
471
|
get :index
|
469
|
-
|
472
|
+
response.body.should_not =~ /Login/
|
470
473
|
end
|
471
474
|
end
|
472
475
|
|
@@ -474,22 +477,22 @@ describe CatalogController do
|
|
474
477
|
describe "requesting js" do
|
475
478
|
it "should be successful" do
|
476
479
|
xhr :get, :facet, id: 'format'
|
477
|
-
|
480
|
+
response.should be_successful
|
478
481
|
end
|
479
482
|
end
|
480
483
|
describe "requesting html" do
|
481
484
|
it "should be successful" do
|
482
485
|
get :facet, id: 'format'
|
483
|
-
|
484
|
-
|
486
|
+
response.should be_successful
|
487
|
+
assigns[:pagination].should be_kind_of Blacklight::Solr::FacetPaginator
|
485
488
|
end
|
486
489
|
end
|
487
490
|
describe "requesting json" do
|
488
491
|
it "should be successful" do
|
489
492
|
get :facet, id: 'format', format: 'json'
|
490
|
-
|
493
|
+
response.should be_successful
|
491
494
|
json = JSON.parse(response.body)
|
492
|
-
|
495
|
+
json["response"]["facets"]["items"].first["value"].should == 'Book'
|
493
496
|
end
|
494
497
|
end
|
495
498
|
end
|
@@ -497,8 +500,8 @@ describe CatalogController do
|
|
497
500
|
describe 'render_search_results_as_json' do
|
498
501
|
before do
|
499
502
|
controller.instance_variable_set :@document_list, [{id: '123', title_t: 'Book1'}, {id: '456', title_t: 'Book2'}]
|
500
|
-
|
501
|
-
|
503
|
+
controller.stub(:pagination_info).and_return({current_page: 1, next_page: 2, prev_page: nil})
|
504
|
+
controller.stub(:search_facets_as_json).and_return(
|
502
505
|
[{name: "format", label: "Format", items: [{value: 'Book', hits: 30, label: 'Book'}]}])
|
503
506
|
end
|
504
507
|
|
@@ -527,18 +530,18 @@ describe CatalogController do
|
|
527
530
|
it "should prepend the current search to the list" do
|
528
531
|
session[:history] = []
|
529
532
|
controller.send(:add_to_search_history, double(:id => 1))
|
530
|
-
expect(session[:history]
|
533
|
+
expect(session[:history]).to have(1).item
|
531
534
|
|
532
535
|
controller.send(:add_to_search_history, double(:id => 2))
|
533
|
-
expect(session[:history]
|
536
|
+
expect(session[:history]).to have(2).items
|
534
537
|
expect(session[:history].first).to eq 2
|
535
538
|
end
|
536
539
|
|
537
540
|
it "should remove searches from the list when the list gets too big" do
|
538
|
-
|
541
|
+
controller.stub(:blacklight_config).and_return(double(:search_history_window => 5))
|
539
542
|
session[:history] = (0..4).to_a.reverse
|
540
543
|
|
541
|
-
expect(session[:history]
|
544
|
+
expect(session[:history]).to have(5).items
|
542
545
|
controller.send(:add_to_search_history, double(:id => 5))
|
543
546
|
controller.send(:add_to_search_history, double(:id => 6))
|
544
547
|
controller.send(:add_to_search_history, double(:id => 7))
|
@@ -549,15 +552,15 @@ describe CatalogController do
|
|
549
552
|
|
550
553
|
describe "current_search_session" do
|
551
554
|
it "should create a session if we're on an search action" do
|
552
|
-
|
553
|
-
|
555
|
+
controller.stub(:action_name => "index")
|
556
|
+
controller.stub(:params => { :q => "x", :page => 5})
|
554
557
|
session = controller.send(:current_search_session)
|
555
558
|
expect(session.query_params).to include(:q => "x")
|
556
559
|
expect(session.query_params).to_not include(:page => 5)
|
557
560
|
end
|
558
561
|
|
559
562
|
it "should create a session if a search context was provided" do
|
560
|
-
|
563
|
+
controller.stub(:params => { :search_context => JSON.dump(:q => "x")})
|
561
564
|
session = controller.send(:current_search_session)
|
562
565
|
expect(session.query_params).to include("q" => "x")
|
563
566
|
end
|
@@ -566,7 +569,7 @@ describe CatalogController do
|
|
566
569
|
s = Search.create(:query_params => { :q => "x" })
|
567
570
|
session[:history] ||= []
|
568
571
|
session[:history] << s.id
|
569
|
-
|
572
|
+
controller.stub(:params => { :search_id => s.id})
|
570
573
|
session = controller.send(:current_search_session)
|
571
574
|
expect(session.query_params).to include(:q => "x")
|
572
575
|
expect(session).to eq(s)
|
@@ -575,7 +578,7 @@ describe CatalogController do
|
|
575
578
|
it "should use an existing search session if the search is in the uri" do
|
576
579
|
s = Search.create(:query_params => { :q => "x" })
|
577
580
|
session[:search] ||= {}
|
578
|
-
session[:search][
|
581
|
+
session[:search][:id] = s.id
|
579
582
|
session[:history] ||= []
|
580
583
|
session[:history] << s.id
|
581
584
|
session = controller.send(:current_search_session)
|
@@ -588,10 +591,10 @@ end
|
|
588
591
|
|
589
592
|
# there must be at least one facet, and each facet must have at least one value
|
590
593
|
def assert_facets_have_values(facets)
|
591
|
-
|
594
|
+
facets.size.should > 1
|
592
595
|
# should have at least one value for each facet
|
593
596
|
facets.each do |facet|
|
594
|
-
|
597
|
+
facet.items.size.should >= 1
|
595
598
|
end
|
596
599
|
end
|
597
600
|
|