blacklight 6.2.0 → 6.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.solr_wrapper +5 -0
- data/.travis.yml +3 -5
- data/Gemfile +3 -3
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/core.js +19 -5
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +48 -20
- data/app/helpers/blacklight/configuration_helper_behavior.rb +1 -1
- data/app/helpers/blacklight/url_helper_behavior.rb +2 -1
- data/app/presenters/blacklight/document_presenter.rb +58 -150
- data/app/presenters/blacklight/field_presenter.rb +31 -0
- data/app/presenters/blacklight/index_presenter.rb +69 -0
- data/app/presenters/blacklight/link_alternate_presenter.rb +29 -0
- data/app/presenters/blacklight/rendering/abstract_step.rb +24 -0
- data/app/presenters/blacklight/rendering/helper_method.rb +23 -0
- data/app/presenters/blacklight/rendering/join.rb +16 -0
- data/app/presenters/blacklight/rendering/link_to_facet.rb +35 -0
- data/app/presenters/blacklight/rendering/microdata.rb +17 -0
- data/app/presenters/blacklight/rendering/pipeline.rb +32 -0
- data/app/presenters/blacklight/rendering/terminator.rb +9 -0
- data/app/presenters/blacklight/show_presenter.rb +93 -0
- data/app/services/blacklight/field_retriever.rb +58 -0
- data/app/views/catalog/_document_default.atom.builder +2 -3
- data/app/views/catalog/_document_default.rss.builder +2 -2
- data/app/views/kaminari/blacklight/_next_page.html.erb +9 -3
- data/app/views/kaminari/blacklight/_prev_page.html.erb +10 -3
- data/lib/blacklight/configuration.rb +15 -3
- data/lib/blacklight/configuration/null_field.rb +13 -0
- data/lib/blacklight/configuration/view_config.rb +6 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +1 -1
- data/lib/generators/blacklight/templates/config/blacklight.yml +1 -1
- data/lib/generators/blacklight/templates/config/jetty.yml +1 -1
- data/spec/controllers/alternate_controller_spec.rb +2 -2
- data/spec/controllers/application_controller_spec.rb +1 -1
- data/spec/controllers/blacklight/facet_spec.rb +3 -3
- data/spec/controllers/blacklight/search_fields_spec.rb +7 -7
- data/spec/controllers/blacklight/search_helper_spec.rb +44 -44
- data/spec/controllers/blacklight/suggest_search_spec.rb +1 -1
- data/spec/controllers/bookmarks_controller_spec.rb +6 -6
- data/spec/controllers/catalog_controller_spec.rb +125 -125
- data/spec/controllers/saved_searches_controller_spec.rb +4 -9
- data/spec/controllers/search_history_controller_spec.rb +3 -6
- data/spec/controllers/suggest_controller_spec.rb +2 -2
- data/spec/features/alternate_controller_spec.rb +3 -3
- data/spec/features/bookmarks_spec.rb +6 -6
- data/spec/features/did_you_mean_spec.rb +10 -10
- data/spec/features/facets_spec.rb +4 -4
- data/spec/features/record_view_spec.rb +4 -4
- data/spec/features/saved_searches_spec.rb +4 -4
- data/spec/features/search_context_spec.rb +4 -4
- data/spec/features/search_filters_spec.rb +10 -10
- data/spec/features/search_formats_spec.rb +2 -2
- data/spec/features/search_history_spec.rb +5 -5
- data/spec/features/search_pagination_spec.rb +4 -4
- data/spec/features/search_results_spec.rb +7 -7
- data/spec/features/search_sort_spec.rb +2 -2
- data/spec/features/search_spec.rb +6 -6
- data/spec/helpers/blacklight_helper_spec.rb +105 -65
- data/spec/helpers/catalog_helper_spec.rb +36 -36
- data/spec/helpers/configuration_helper_spec.rb +28 -28
- data/spec/helpers/facets_helper_spec.rb +39 -39
- data/spec/helpers/hash_as_hidden_fields_spec.rb +1 -1
- data/spec/helpers/render_constraints_helper_spec.rb +1 -1
- data/spec/helpers/search_history_constraints_helper_spec.rb +7 -7
- data/spec/helpers/url_helper_spec.rb +20 -17
- data/spec/lib/blacklight/search_state_spec.rb +2 -2
- data/spec/lib/blacklight/utils_spec.rb +15 -15
- data/spec/lib/blacklight_spec.rb +1 -1
- data/spec/lib/tasks/blacklight_task_spec.rb +1 -1
- data/spec/models/blacklight/configurable_spec.rb +3 -3
- data/spec/models/blacklight/configuration_spec.rb +52 -52
- data/spec/models/blacklight/document_spec.rb +10 -10
- data/spec/models/blacklight/facet_paginator_spec.rb +5 -5
- data/spec/models/blacklight/search_builder_spec.rb +34 -34
- data/spec/models/blacklight/user_spec.rb +4 -4
- data/spec/models/bookmark_spec.rb +5 -5
- data/spec/models/record_mailer_spec.rb +11 -11
- data/spec/models/search_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +4 -4
- data/spec/presenters/document_presenter_spec.rb +94 -50
- data/spec/presenters/index_presenter_spec.rb +147 -0
- data/spec/presenters/pipeline_spec.rb +28 -0
- data/spec/presenters/show_presenter_spec.rb +287 -0
- data/spec/routing/catalog_routing_spec.rb +11 -11
- data/spec/spec_helper.rb +10 -1
- data/spec/support/backport_test.rb +38 -0
- data/spec/test_app_templates/Gemfile.extra +2 -10
- data/spec/views/_user_util_links.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_constraints.html.erb_spec.rb +3 -3
- data/spec/views/catalog/_constraints_element.html.erb_spec.rb +5 -5
- data/spec/views/catalog/_document.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_document_list.html.erb_spec.rb +1 -1
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_facets.html.erb_spec.rb +4 -4
- data/spec/views/catalog/_index_default.erb_spec.rb +5 -4
- data/spec/views/catalog/_index_header_default.html.erb_spec.rb +4 -3
- data/spec/views/catalog/_paginate_compact.html.erb_spec.rb +3 -3
- data/spec/views/catalog/_search_header.erb_spec.rb +1 -1
- data/spec/views/catalog/_show_default.erb_spec.rb +6 -5
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +2 -1
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +8 -8
- data/spec/views/catalog/_sort_and_per_page.html.erb_spec.rb +2 -2
- data/spec/views/catalog/_thumbnail_default.erb_spec.rb +3 -2
- data/spec/views/catalog/_view_type_group.html.erb_spec.rb +3 -3
- data/spec/views/catalog/facet.html.erb_spec.rb +3 -3
- data/spec/views/catalog/index.atom.builder_spec.rb +15 -14
- data/spec/views/catalog/index.html.erb_spec.rb +3 -3
- data/spec/views/catalog/opensearch.xml.builder_spec.rb +1 -1
- data/spec/views/catalog/show.html.erb_spec.rb +5 -4
- data/tasks/blacklight.rake +1 -1
- metadata +25 -4
- data/config/jetty.yml +0 -13
@@ -16,23 +16,18 @@ describe SavedSearchesController do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
describe "save" do
|
19
|
-
it "
|
20
|
-
|
19
|
+
it "lets you save a search" do
|
21
20
|
request.env["HTTP_REFERER"] = "where_i_came_from"
|
22
21
|
session[:history] = [@one.id]
|
23
|
-
post :save, :id
|
22
|
+
post :save, params: { id: @one.id }
|
24
23
|
expect(response).to redirect_to "where_i_came_from"
|
25
24
|
end
|
26
25
|
|
27
|
-
it "
|
26
|
+
it "does not let you save a search that isn't in your search history" do
|
28
27
|
session[:history] = [@one.id]
|
29
28
|
expect {
|
30
|
-
post :save, :id
|
29
|
+
post :save, params: { id: @two.id }
|
31
30
|
}.to raise_error ActiveRecord::RecordNotFound
|
32
31
|
end
|
33
|
-
|
34
32
|
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
33
|
end
|
@@ -11,7 +11,7 @@ describe SearchHistoryController do
|
|
11
11
|
@three = Search.create
|
12
12
|
end
|
13
13
|
|
14
|
-
it "
|
14
|
+
it "onlies fetch searches with ids in the session" do
|
15
15
|
session[:history] = [@one.id, @three.id]
|
16
16
|
get :index
|
17
17
|
@searches = assigns(:searches)
|
@@ -21,7 +21,7 @@ describe SearchHistoryController do
|
|
21
21
|
expect(@searches).to_not include(@two)
|
22
22
|
end
|
23
23
|
|
24
|
-
it "
|
24
|
+
it "tolerates bad ids in session" do
|
25
25
|
session[:history] = [@one.id, @three.id, "NOT_IN_DB"]
|
26
26
|
get :index
|
27
27
|
@searches = assigns(:searches)
|
@@ -30,14 +30,11 @@ describe SearchHistoryController do
|
|
30
30
|
expect(@searches).to include(@three)
|
31
31
|
end
|
32
32
|
|
33
|
-
it "
|
33
|
+
it "does not fetch any searches if there is no history" do
|
34
34
|
session[:history] = []
|
35
35
|
get :index
|
36
36
|
@searches = assigns(:searches)
|
37
37
|
expect(@searches).to be_empty
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
41
|
-
|
42
|
-
|
43
40
|
end
|
@@ -5,11 +5,11 @@ describe SuggestController do
|
|
5
5
|
routes { Blacklight::Engine.routes }
|
6
6
|
describe 'GET index' do
|
7
7
|
it 'returns JSON' do
|
8
|
-
get :index, format: 'json'
|
8
|
+
get :index, params: { format: 'json' }
|
9
9
|
expect(response.body).to eq [].to_json
|
10
10
|
end
|
11
11
|
it 'returns suggestions' do
|
12
|
-
get :index, format: 'json', q: 'new'
|
12
|
+
get :index, params: { format: 'json', q: 'new' }
|
13
13
|
json = JSON.parse(response.body)
|
14
14
|
expect(json.count).to eq 3
|
15
15
|
expect(json.first['term']).to eq 'new jersey'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe "Alternate Controller Behaviors" do
|
5
|
-
it "
|
5
|
+
it "has the correct per-page form" do
|
6
6
|
visit search_alternate_path
|
7
7
|
expect(page).to have_selector("form[action='#{search_alternate_url}']")
|
8
8
|
fill_in "q", :with=>"history"
|
@@ -14,7 +14,7 @@ describe "Alternate Controller Behaviors" do
|
|
14
14
|
expect(current_path).to match /#{search_alternate_path}/
|
15
15
|
end
|
16
16
|
|
17
|
-
it "
|
17
|
+
it "has the correct search field form" do
|
18
18
|
visit search_alternate_path
|
19
19
|
expect(page).to have_selector("form[action='#{search_alternate_url}']")
|
20
20
|
fill_in "q", :with=>"history"
|
@@ -24,7 +24,7 @@ describe "Alternate Controller Behaviors" do
|
|
24
24
|
expect(current_path).to match /#{search_alternate_path}/
|
25
25
|
end
|
26
26
|
|
27
|
-
it "
|
27
|
+
it "displays document thumbnails" do
|
28
28
|
visit search_alternate_path
|
29
29
|
expect(page).to have_selector("form[action='#{search_alternate_url}']")
|
30
30
|
fill_in "q", :with=>"history"
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe "Bookmarks" do
|
5
5
|
describe "navigating from the homepage" do
|
6
|
-
it "
|
6
|
+
it "has a link to the history page" do
|
7
7
|
sign_in 'user1'
|
8
8
|
visit root_path
|
9
9
|
click_link 'Bookmarks'
|
@@ -11,7 +11,7 @@ describe "Bookmarks" do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
it "
|
14
|
+
it "clears bookmarks" do
|
15
15
|
visit solr_document_path('2007020969')
|
16
16
|
click_button 'Bookmark'
|
17
17
|
click_link 'Bookmarks'
|
@@ -33,7 +33,7 @@ describe "Bookmarks" do
|
|
33
33
|
expect(page).to have_content 'Successfully removed bookmark.'
|
34
34
|
end
|
35
35
|
|
36
|
-
it "
|
36
|
+
it "adds and delete bookmarks from the show page" do
|
37
37
|
sign_in 'user1'
|
38
38
|
visit solr_document_path('2007020969')
|
39
39
|
click_button 'Bookmark'
|
@@ -41,7 +41,7 @@ describe "Bookmarks" do
|
|
41
41
|
expect(page).to have_content 'Successfully removed bookmark.'
|
42
42
|
end
|
43
43
|
|
44
|
-
it "
|
44
|
+
it "adds bookmarks after a user logs in" do
|
45
45
|
visit solr_document_path('2007020969')
|
46
46
|
click_button 'Bookmark'
|
47
47
|
sign_in 'user1'
|
@@ -50,7 +50,7 @@ describe "Bookmarks" do
|
|
50
50
|
expect(page).to have_content("Strong Medicine speaks")
|
51
51
|
end
|
52
52
|
|
53
|
-
it "
|
53
|
+
it "cites items in bookmarks" do
|
54
54
|
visit solr_document_path('2007020969')
|
55
55
|
click_button 'Bookmark'
|
56
56
|
click_link 'Bookmarks'
|
@@ -58,7 +58,7 @@ describe "Bookmarks" do
|
|
58
58
|
expect(page).to have_content 'Strong Medicine speaks'
|
59
59
|
end
|
60
60
|
|
61
|
-
it "
|
61
|
+
it "cites items in current bookmarks page" do
|
62
62
|
visit solr_document_path('2009373513')
|
63
63
|
click_button 'Bookmark'
|
64
64
|
|
@@ -5,7 +5,7 @@ describe "Did You Mean" do
|
|
5
5
|
before { visit root_path }
|
6
6
|
|
7
7
|
describe "searching all fields" do
|
8
|
-
it "
|
8
|
+
it "has suggestions" do
|
9
9
|
fill_in "q", with: 'politica'
|
10
10
|
click_button 'search'
|
11
11
|
|
@@ -19,7 +19,7 @@ describe "Did You Mean" do
|
|
19
19
|
|
20
20
|
describe "for a title search" do
|
21
21
|
before { select 'Title', from: 'search_field' }
|
22
|
-
it "
|
22
|
+
it "has suggestions" do
|
23
23
|
# yehudiyam is one letter away from a title word
|
24
24
|
fill_in "q", with: 'yehudiyam'
|
25
25
|
click_button 'search'
|
@@ -37,7 +37,7 @@ describe "Did You Mean" do
|
|
37
37
|
|
38
38
|
describe "for an author search" do
|
39
39
|
before { select 'Author', from: 'search_field' }
|
40
|
-
it "
|
40
|
+
it "has suggestions" do
|
41
41
|
# shirma is one letter away from an author word
|
42
42
|
fill_in "q", with: 'shirma'
|
43
43
|
click_button 'search'
|
@@ -55,7 +55,7 @@ describe "Did You Mean" do
|
|
55
55
|
|
56
56
|
describe "for an subject search" do
|
57
57
|
before { select 'Subject', from: 'search_field' }
|
58
|
-
it "
|
58
|
+
it "has suggestions" do
|
59
59
|
# wome is one letter away from an author word
|
60
60
|
fill_in "q", with: 'wome'
|
61
61
|
click_button 'search'
|
@@ -72,14 +72,14 @@ describe "Did You Mean" do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
describe "a multiword query" do
|
75
|
-
it "
|
75
|
+
it "does not have suggestions if there are no matches" do
|
76
76
|
fill_in "q", with: 'ooofda ooofda'
|
77
77
|
click_button 'search'
|
78
78
|
|
79
79
|
expect(page).to_not have_content("Did you mean")
|
80
80
|
end
|
81
81
|
|
82
|
-
it "
|
82
|
+
it "has separate suggestions" do
|
83
83
|
fill_in "q", with: 'politica boo'
|
84
84
|
click_button 'search'
|
85
85
|
|
@@ -96,7 +96,7 @@ describe "Did You Mean" do
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
it "
|
99
|
+
it "ignores repeated terms" do
|
100
100
|
fill_in "q", with: 'boo boo'
|
101
101
|
click_button 'search'
|
102
102
|
|
@@ -108,7 +108,7 @@ describe "Did You Mean" do
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
it "
|
111
|
+
it "shows suggestions if there aren't many hits" do
|
112
112
|
fill_in "q", with: 'ayaz'
|
113
113
|
click_button 'search'
|
114
114
|
|
@@ -119,14 +119,14 @@ describe "Did You Mean" do
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
it "
|
122
|
+
it "does not show suggestions if there are many results" do
|
123
123
|
# histori gives 9 results in 30 record demo index
|
124
124
|
fill_in "q", with: 'histori'
|
125
125
|
click_button 'search'
|
126
126
|
expect(page).to_not have_content("Did you mean")
|
127
127
|
end
|
128
128
|
|
129
|
-
it "
|
129
|
+
it "shows suggestions if at the threshold number" do
|
130
130
|
# polit gives 5 results in 30 record demo index - 5 is default cutoff
|
131
131
|
fill_in "q", with: 'polit'
|
132
132
|
click_button 'search'
|
@@ -2,13 +2,13 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe "Facets" do
|
5
|
-
it "
|
5
|
+
it "shows a single facet's values" do
|
6
6
|
visit facet_catalog_path("language_facet")
|
7
7
|
expect(page).to have_selector ".modal-title", :text => "Language"
|
8
8
|
expect(page).to have_selector ".facet_select", :text => "Tibetan"
|
9
9
|
end
|
10
10
|
|
11
|
-
it "
|
11
|
+
it "paginates through a facet's values" do
|
12
12
|
visit facet_catalog_path("subject_topic_facet")
|
13
13
|
expect(page).to have_selector '.facet-values li:first', text: "Japanese drama"
|
14
14
|
expect(page).to have_link "A-Z Sort"
|
@@ -20,7 +20,7 @@ describe "Facets" do
|
|
20
20
|
expect(page).to have_link "« Previous"
|
21
21
|
end
|
22
22
|
|
23
|
-
it "
|
23
|
+
it "is able to change the facet sort" do
|
24
24
|
visit facet_catalog_path("subject_topic_facet")
|
25
25
|
expect(page).to have_selector '.facet-values li:first', text: "Japanese drama"
|
26
26
|
within ".modal-footer" do
|
@@ -31,7 +31,7 @@ describe "Facets" do
|
|
31
31
|
expect(page).to have_selector '.sort_options .active', text: "A-Z Sort"
|
32
32
|
end
|
33
33
|
|
34
|
-
it "
|
34
|
+
it "is able to sort more facet window by letter" do
|
35
35
|
visit facet_catalog_path("subject_topic_facet")
|
36
36
|
within ".modal-footer" do
|
37
37
|
click_on "A-Z Sort"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe "Record View" do
|
5
|
-
it "
|
5
|
+
it "displays a normal record" do
|
6
6
|
visit solr_document_path('2007020969')
|
7
7
|
expect(page).to have_content "Title:"
|
8
8
|
expect(page).to have_content "Strong Medicine speaks"
|
@@ -21,18 +21,18 @@ describe "Record View" do
|
|
21
21
|
|
22
22
|
end
|
23
23
|
|
24
|
-
it "
|
24
|
+
it "does not display blank titles" do
|
25
25
|
visit solr_document_path('2008305903')
|
26
26
|
expect(page).not_to have_content "More Information:"
|
27
27
|
end
|
28
28
|
|
29
|
-
it "
|
29
|
+
it "does not display vernacular records" do
|
30
30
|
visit solr_document_path('2009373513')
|
31
31
|
expect(page).to have_content "次按驟變"
|
32
32
|
expect(page).to have_content "林行止"
|
33
33
|
expect(page).to have_content "臺北縣板橋市"
|
34
34
|
end
|
35
|
-
it "
|
35
|
+
it "does not display 404" do
|
36
36
|
visit solr_document_path('this_id_does_not_exist')
|
37
37
|
expect(page.driver.status_code).to eq 404
|
38
38
|
expect(page).to have_content "The page you were looking for doesn't exist."
|
@@ -7,7 +7,7 @@ describe "Saved Searches" do
|
|
7
7
|
visit root_path
|
8
8
|
end
|
9
9
|
|
10
|
-
it "
|
10
|
+
it "is empty" do
|
11
11
|
click_link 'Saved Searches'
|
12
12
|
expect(page).to have_content 'You have no saved searches'
|
13
13
|
end
|
@@ -20,11 +20,11 @@ describe "Saved Searches" do
|
|
20
20
|
click_button "save"
|
21
21
|
click_link 'Saved Searches'
|
22
22
|
end
|
23
|
-
it "
|
23
|
+
it "shows saved searches" do
|
24
24
|
expect(page).to have_content 'Your saved searches'
|
25
25
|
expect(page).to have_content 'book'
|
26
26
|
end
|
27
|
-
it "
|
27
|
+
it "deletes saved searches" do
|
28
28
|
click_button 'delete'
|
29
29
|
expect(page).to have_content 'Successfully removed that saved search.'
|
30
30
|
end
|
@@ -38,7 +38,7 @@ describe "Saved Searches" do
|
|
38
38
|
click_button "save"
|
39
39
|
click_link 'Saved Searches'
|
40
40
|
end
|
41
|
-
it "
|
41
|
+
it "clears the searhes" do
|
42
42
|
click_link "Clear Saved Searches"
|
43
43
|
expect(page).to have_content 'Cleared your saved searches.'
|
44
44
|
expect(page).to have_content 'You have no saved searches'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe "Search Results context", js: true do
|
5
|
-
it "
|
5
|
+
it "passes the current search id through" do
|
6
6
|
search_for ''
|
7
7
|
search_id = Search.last.id.to_s
|
8
8
|
click_on 'Pluvial nectar of blessings'
|
@@ -16,14 +16,14 @@ describe "Search Results context", js: true do
|
|
16
16
|
expect(prev['data-context-href']).to eq "/catalog/2004310986/track?counter=8&search_id=#{search_id}"
|
17
17
|
end
|
18
18
|
|
19
|
-
it "
|
19
|
+
it "redirects context urls to the original url" do
|
20
20
|
search_for ''
|
21
21
|
first('.index_title a').click
|
22
22
|
expect(page).to have_content "« Previous | 1 of 30 | Next »"
|
23
23
|
expect(page.current_url).to_not have_content "/track"
|
24
24
|
end
|
25
25
|
|
26
|
-
it '
|
26
|
+
it 'shows "Back to Search" and "Start Over links"' do
|
27
27
|
search_for 'Bod kyi naṅ chos ṅo sprod sñiṅ bsdus'
|
28
28
|
first('.index_title a').click
|
29
29
|
within '.pagination-search-widgets' do
|
@@ -33,7 +33,7 @@ describe "Search Results context", js: true do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
context "navigating between search results using context pagination" do
|
36
|
-
it "
|
36
|
+
it "updates the back to search link with the current search pagination context" do
|
37
37
|
search_for ''
|
38
38
|
first('.index_title a').click
|
39
39
|
10.times do
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe "Facets" do
|
5
|
-
it "
|
5
|
+
it "works without a search term" do
|
6
6
|
visit root_path
|
7
7
|
within "#facet-language_facet" do
|
8
8
|
click_link "Tibetan"
|
@@ -33,7 +33,7 @@ describe "Facets" do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
it "
|
36
|
+
it "works in conjunction with a search term" do
|
37
37
|
visit root_path
|
38
38
|
fill_in "q", with: 'history'
|
39
39
|
click_button 'search'
|
@@ -71,7 +71,7 @@ describe "Facets" do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
it "
|
74
|
+
it "allows removing filters" do
|
75
75
|
visit root_path
|
76
76
|
within "#facet-language_facet" do
|
77
77
|
click_link "Tibetan"
|
@@ -87,7 +87,7 @@ describe "Facets" do
|
|
87
87
|
expect(page).to have_content('Welcome!')
|
88
88
|
end
|
89
89
|
|
90
|
-
it "
|
90
|
+
it "retains filters when you change the search term" do
|
91
91
|
visit root_path
|
92
92
|
fill_in "q", with: 'history'
|
93
93
|
click_button 'search'
|
@@ -122,7 +122,7 @@ describe "Facets" do
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
-
it "
|
125
|
+
it "retains the filters when we change sort" do
|
126
126
|
visit root_path
|
127
127
|
fill_in "q", with: 'history'
|
128
128
|
click_button 'search'
|
@@ -144,7 +144,7 @@ describe "Facets" do
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
|
-
it "
|
147
|
+
it "retains the filters when we change per page number" do
|
148
148
|
visit root_path
|
149
149
|
fill_in "q", with: 'history'
|
150
150
|
click_button 'search'
|
@@ -167,14 +167,14 @@ describe "Facets" do
|
|
167
167
|
expect(page).to have_content "history"
|
168
168
|
end
|
169
169
|
end
|
170
|
-
it "
|
170
|
+
it "is collapsed when not selected", :js => true do
|
171
171
|
skip("Test passes locally but not on Travis.") if ENV['TRAVIS']
|
172
172
|
visit root_path
|
173
173
|
within(".blacklight-subject_topic_facet") do
|
174
174
|
expect(page).not_to have_selector(".panel-collapse", :visible => true)
|
175
175
|
end
|
176
176
|
end
|
177
|
-
it "
|
177
|
+
it "expands when the heading is clicked", :js => true do
|
178
178
|
skip("Test passes locally but not on Travis.") if ENV['TRAVIS']
|
179
179
|
visit root_path
|
180
180
|
within(".blacklight-subject_topic_facet") do
|
@@ -183,7 +183,7 @@ describe "Facets" do
|
|
183
183
|
expect(page).to have_selector(".panel-collapse", :visible => true)
|
184
184
|
end
|
185
185
|
end
|
186
|
-
it "
|
186
|
+
it "expands when the anchor is clicked", :js => true do
|
187
187
|
skip("Test passes locally but not on Travis.") if ENV['TRAVIS']
|
188
188
|
visit root_path
|
189
189
|
within(".blacklight-subject_topic_facet") do
|
@@ -192,7 +192,7 @@ describe "Facets" do
|
|
192
192
|
expect(page).to have_selector(".panel-collapse", :visible => true)
|
193
193
|
end
|
194
194
|
end
|
195
|
-
it "
|
195
|
+
it "keeps selected facets expanded on page load", :js => true do
|
196
196
|
skip("Test passes locally but not on Travis.") if ENV['TRAVIS']
|
197
197
|
visit root_path
|
198
198
|
within(".blacklight-subject_topic_facet") do
|