blacklight 8.11.0 → 9.0.0.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +3 -3
- data/.github/matrix.json +11 -42
- data/.github/pull_request_template.md +7 -0
- data/.github/workflows/main.yml +0 -2
- data/.github/workflows/release_7_x_scheduled.yml +39 -0
- data/.github/workflows/release_8_x_scheduled.yml +39 -0
- data/.github/workflows/test.yml +0 -5
- data/.rubocop.yml +71 -3
- data/.rubocop_todo.yml +43 -76
- data/.solr_wrapper.yml +2 -0
- data/README.md +30 -8
- data/VERSION +1 -1
- data/app/assets/builds/blacklight.css +452 -0
- data/app/assets/javascripts/blacklight/blacklight.esm.js +6 -76
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +6 -76
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_balanced_list.scss +1 -4
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -3
- data/app/assets/stylesheets/blacklight/_bookmark.scss +44 -41
- data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +0 -25
- data/app/assets/stylesheets/blacklight/_constraints.scss +15 -24
- data/app/assets/stylesheets/blacklight/_controls.scss +2 -18
- data/app/assets/stylesheets/blacklight/_facets.scss +17 -84
- data/app/assets/stylesheets/blacklight/_group.scss +2 -5
- data/app/assets/stylesheets/blacklight/_header.scss +8 -11
- data/app/assets/stylesheets/blacklight/_icons.scss +0 -8
- data/app/assets/stylesheets/blacklight/_modal.scss +1 -1
- data/app/assets/stylesheets/blacklight/_pagination.scss +0 -4
- data/app/assets/stylesheets/blacklight/_search_form.scss +0 -1
- data/app/assets/stylesheets/blacklight/_search_history.scss +0 -8
- data/app/assets/stylesheets/blacklight/_search_results.scss +1 -15
- data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +9 -14
- data/app/assets/stylesheets/blacklight/build.scss +4 -0
- data/app/components/blacklight/advanced_search_form_component.rb +3 -3
- data/app/components/blacklight/constraint_component.rb +1 -1
- data/app/components/blacklight/constraint_layout_component.html.erb +2 -2
- data/app/components/blacklight/constraints_component.html.erb +2 -2
- data/app/components/blacklight/constraints_component.rb +3 -3
- data/app/components/blacklight/document/bookmark_component.html.erb +3 -3
- data/app/components/blacklight/document/bookmark_component.rb +2 -2
- data/app/components/blacklight/document/group_component.html.erb +1 -1
- data/app/components/blacklight/document/more_like_this_component.rb +2 -2
- data/app/components/blacklight/document/page_header_component.rb +1 -1
- data/app/components/blacklight/document/sidebar_component.rb +5 -5
- data/app/components/blacklight/document/thumbnail_component.html.erb +3 -7
- data/app/components/blacklight/document/thumbnail_component.rb +7 -6
- data/app/components/blacklight/document_component.rb +12 -16
- data/app/components/blacklight/document_title_component.rb +5 -11
- data/app/components/blacklight/facet_field_checkboxes_component.rb +2 -20
- data/app/components/blacklight/facet_field_component.rb +2 -17
- data/app/components/blacklight/facet_field_filter_component.rb +2 -21
- data/app/components/blacklight/facet_field_inclusive_constraint_component.rb +4 -25
- data/app/components/blacklight/facet_field_list_component.rb +2 -50
- data/app/components/blacklight/facet_field_no_layout_component.rb +2 -10
- data/app/components/blacklight/facet_item_component.rb +2 -74
- data/app/components/blacklight/facet_item_pivot_component.rb +3 -3
- data/app/components/blacklight/facets/checkboxes_component.rb +26 -0
- data/app/components/blacklight/facets/count_component.rb +23 -0
- data/app/components/blacklight/{facet_field_component.html.erb → facets/field_component.html.erb} +4 -4
- data/app/components/blacklight/facets/field_component.rb +23 -0
- data/app/components/blacklight/facets/filters_component.html.erb +4 -0
- data/app/components/blacklight/facets/filters_component.rb +27 -0
- data/app/components/blacklight/{facet_field_inclusive_constraint_component.html.erb → facets/inclusive_constraint_component.html.erb} +1 -1
- data/app/components/blacklight/facets/inclusive_constraint_component.rb +31 -0
- data/app/components/blacklight/{facet_field_filter_component.html.erb → facets/index_navigation_component.html.erb} +1 -1
- data/app/components/blacklight/facets/index_navigation_component.rb +32 -0
- data/app/components/blacklight/facets/item_component.rb +73 -0
- data/app/components/blacklight/facets/list_component.html.erb +11 -0
- data/app/components/blacklight/facets/list_component.rb +38 -0
- data/app/components/blacklight/facets/no_layout_component.rb +16 -0
- data/app/components/blacklight/facets/selected_value_component.rb +29 -0
- data/app/components/blacklight/facets/suggest_component.html.erb +12 -0
- data/app/components/blacklight/facets/suggest_component.rb +22 -0
- data/app/components/blacklight/metadata_field_plain_text_layout_component.rb +2 -2
- data/app/components/blacklight/response/facet_group_component.html.erb +3 -18
- data/app/components/blacklight/response/facet_group_component.rb +11 -23
- data/app/components/blacklight/response/facet_toggle_button_component.html.erb +16 -0
- data/app/components/blacklight/response/facet_toggle_button_component.rb +14 -0
- data/app/components/blacklight/response/pagination_component.html.erb +1 -1
- data/app/components/blacklight/response/pagination_component.rb +2 -1
- data/app/components/blacklight/response/sort_component.rb +1 -0
- data/app/components/blacklight/response/view_type_button_component.html.erb +1 -1
- data/app/components/blacklight/response/view_type_component.html.erb +1 -1
- data/app/components/blacklight/search/per_page_component.html.erb +1 -1
- data/app/components/blacklight/search/per_page_component.rb +1 -0
- data/app/components/blacklight/search/sidebar_component.html.erb +1 -1
- data/app/components/blacklight/search/sidebar_component.rb +1 -1
- data/app/components/blacklight/search_bar_component.html.erb +3 -3
- data/app/components/blacklight/search_bar_component.rb +2 -2
- data/app/components/blacklight/search_button_component.rb +2 -2
- data/app/components/blacklight/search_context/server_applied_params_component.html.erb +2 -2
- data/app/components/blacklight/search_context/server_applied_params_component.rb +9 -0
- data/app/components/blacklight/skip_link_component.html.erb +1 -1
- data/app/components/blacklight/skip_link_component.rb +2 -1
- data/app/components/blacklight/top_navbar_component.html.erb +2 -2
- data/app/controllers/concerns/blacklight/bookmarks.rb +3 -3
- data/app/controllers/concerns/blacklight/catalog.rb +9 -23
- data/app/controllers/concerns/blacklight/controller.rb +1 -1
- data/app/controllers/concerns/blacklight/facetable.rb +34 -0
- data/app/controllers/concerns/blacklight/search_context.rb +0 -12
- data/app/controllers/concerns/blacklight/searchable.rb +1 -1
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +0 -6
- data/app/helpers/blacklight/catalog_helper_behavior.rb +0 -10
- data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -14
- data/app/helpers/blacklight/document_helper_behavior.rb +3 -27
- data/app/helpers/blacklight/facets_helper_behavior.rb +9 -0
- data/app/helpers/blacklight/icon_helper_behavior.rb +3 -11
- data/app/helpers/blacklight/layout_helper_behavior.rb +2 -2
- data/app/helpers/blacklight/render_partials_helper_behavior.rb +0 -14
- data/app/helpers/blacklight/url_helper_behavior.rb +1 -1
- data/app/javascript/{blacklight → blacklight-frontend}/bookmark_toggle.js +1 -1
- data/app/javascript/{blacklight → blacklight-frontend}/checkbox_submit.js +3 -0
- data/app/javascript/{blacklight → blacklight-frontend}/core.js +2 -10
- data/app/javascript/{blacklight → blacklight-frontend}/facet_suggest.js +1 -3
- data/app/javascript/blacklight-frontend/index.js +16 -0
- data/app/javascript/{blacklight → blacklight-frontend}/modal.js +1 -5
- data/app/models/concerns/blacklight/document.rb +0 -11
- data/app/models/concerns/blacklight/user.rb +1 -1
- data/app/models/facet_search_builder.rb +5 -0
- data/app/presenters/blacklight/facet_field_presenter.rb +3 -3
- data/app/presenters/blacklight/rendering/helper_method.rb +4 -4
- data/app/presenters/blacklight/rendering/join.rb +2 -2
- data/app/services/blacklight/facet_search_service.rb +44 -0
- data/app/services/blacklight/field_retriever.rb +1 -1
- data/app/services/blacklight/search_params_yaml_coder.rb +0 -2
- data/app/services/blacklight/search_service.rb +6 -6
- data/app/values/blacklight/types.rb +2 -2
- data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +0 -2
- data/app/views/bookmarks/index.html.erb +1 -1
- data/app/views/catalog/_facet_pivot.html.erb +1 -1
- data/app/views/catalog/_home_text.html.erb +2 -2
- data/app/views/catalog/_results_pagination.html.erb +2 -5
- data/app/views/catalog/_search_results.html.erb +3 -3
- data/app/views/catalog/_search_results_header.html.erb +1 -1
- data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
- data/app/views/catalog/_sort_widget.html.erb +1 -0
- data/app/views/catalog/facet.html.erb +4 -6
- data/app/views/catalog/show.html.erb +2 -3
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -2
- data/app/views/layouts/blacklight/base.html.erb +3 -7
- data/app/views/search_history/index.html.erb +0 -2
- data/blacklight.gemspec +4 -4
- data/config/importmap.rb +1 -1
- data/config/locales/blacklight.ar.yml +2 -2
- data/config/locales/blacklight.ca.yml +124 -124
- data/config/locales/blacklight.de.yml +2 -2
- data/config/locales/blacklight.en.yml +14 -14
- data/config/locales/blacklight.es.yml +2 -2
- data/config/locales/blacklight.fr.yml +2 -2
- data/config/locales/blacklight.hu.yml +2 -2
- data/config/locales/blacklight.it.yml +1 -1
- data/config/locales/blacklight.nl.yml +2 -2
- data/config/locales/blacklight.pt-BR.yml +1 -1
- data/config/locales/blacklight.sq.yml +2 -2
- data/config/locales/blacklight.zh.yml +2 -2
- data/lib/blacklight/abstract_repository.rb +2 -2
- data/lib/blacklight/abstract_search_builder.rb +154 -0
- data/lib/blacklight/configuration/context.rb +3 -3
- data/lib/blacklight/configuration/display_field.rb +1 -1
- data/lib/blacklight/configuration/facet_field.rb +6 -6
- data/lib/blacklight/configuration/field.rb +4 -4
- data/lib/blacklight/configuration/fields.rb +3 -4
- data/lib/blacklight/configuration/search_field.rb +1 -1
- data/lib/blacklight/configuration/view_config.rb +2 -4
- data/lib/blacklight/configuration.rb +11 -18
- data/lib/blacklight/engine.rb +0 -6
- data/lib/blacklight/facet_search_builder.rb +18 -0
- data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
- data/lib/blacklight/open_struct_with_hash_access.rb +5 -5
- data/lib/blacklight/search_builder.rb +1 -159
- data/lib/blacklight/search_state/filter_field.rb +2 -2
- data/lib/blacklight/search_state/pivot_filter_field.rb +4 -4
- data/lib/blacklight/solr/abstract_filter_query_builder.rb +77 -0
- data/lib/blacklight/solr/default_filter_query_builder.rb +20 -0
- data/lib/blacklight/solr/facet_search_builder_behavior.rb +62 -0
- data/lib/blacklight/solr/repository.rb +8 -9
- data/lib/blacklight/solr/request.rb +1 -7
- data/lib/blacklight/solr/response/facets.rb +2 -2
- data/lib/blacklight/solr/response/group_response.rb +2 -2
- data/lib/blacklight/solr/response/params.rb +0 -4
- data/lib/blacklight/solr/response.rb +5 -1
- data/lib/blacklight/solr/search_builder_behavior.rb +17 -132
- data/lib/blacklight.rb +2 -2
- data/lib/generators/blacklight/assets/importmap_generator.rb +6 -24
- data/lib/generators/blacklight/assets/propshaft_generator.rb +1 -1
- data/lib/generators/blacklight/assets_generator.rb +3 -3
- data/lib/generators/blacklight/controller_generator.rb +3 -3
- data/lib/generators/blacklight/search_builder_generator.rb +1 -1
- data/lib/generators/blacklight/templates/.solr_wrapper.yml +2 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +3 -1
- data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +0 -4
- data/lib/generators/blacklight/user_generator.rb +9 -10
- data/package.json +15 -5
- data/rollup.config.js +1 -1
- data/spec/components/blacklight/advanced_search_form_component_spec.rb +18 -22
- data/spec/components/blacklight/constraint_layout_component_spec.rb +8 -8
- data/spec/components/blacklight/constraints_component_spec.rb +11 -11
- data/spec/components/blacklight/document/action_component_spec.rb +21 -17
- data/spec/components/blacklight/document/group_component_spec.rb +10 -15
- data/spec/components/blacklight/document/page_header_component_spec.rb +35 -28
- data/spec/components/blacklight/document/sidebar_component_spec.rb +9 -30
- data/spec/components/blacklight/document_component_spec.rb +98 -65
- data/spec/components/blacklight/facet_component_spec.rb +12 -8
- data/spec/components/blacklight/facet_item_pivot_component_spec.rb +12 -12
- data/spec/components/blacklight/{facet_field_checkboxes_component_spec.rb → facets/checkboxes_component_spec.rb} +14 -14
- data/spec/components/blacklight/facets/filters_component_spec.rb +36 -0
- data/spec/components/blacklight/facets/index_navigation_component_spec.rb +40 -0
- data/spec/components/blacklight/{facet_item_component_spec.rb → facets/item_component_spec.rb} +10 -10
- data/spec/components/blacklight/{facet_field_list_component_spec.rb → facets/list_component_spec.rb} +24 -24
- data/spec/components/blacklight/facets/suggest_component_spec.rb +68 -0
- data/spec/components/blacklight/header_component_spec.rb +2 -4
- data/spec/components/blacklight/hidden_search_state_component_spec.rb +7 -7
- data/spec/components/blacklight/metadata_field_component_spec.rb +17 -15
- data/spec/components/blacklight/response/facet_group_component_spec.rb +37 -0
- data/spec/components/blacklight/response/pagination_component_spec.rb +1 -1
- data/spec/components/blacklight/response/spellcheck_component_spec.rb +1 -1
- data/spec/components/blacklight/search_bar_component_spec.rb +5 -5
- data/spec/components/blacklight/search_context/server_applied_params_component_spec.rb +2 -2
- data/spec/components/blacklight/search_context/server_item_pagination_component_spec.rb +3 -5
- data/spec/components/blacklight/skip_link_component_spec.rb +8 -11
- data/spec/components/blacklight/start_over_button_component_spec.rb +4 -4
- data/spec/components/blacklight/system/flash_message_component_spec.rb +7 -11
- data/spec/controllers/catalog_controller_spec.rb +11 -19
- data/spec/features/axe_spec.rb +6 -11
- data/spec/features/bookmarks_spec.rb +48 -11
- data/spec/features/facets_spec.rb +58 -63
- data/spec/features/search_context_spec.rb +1 -2
- data/spec/features/search_filters_spec.rb +6 -6
- data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +0 -9
- data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +10 -0
- data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +1 -1
- data/spec/lib/blacklight/configuration/facet_field_spec.rb +2 -2
- data/spec/models/blacklight/configuration_spec.rb +32 -28
- data/spec/models/blacklight/facet_search_builder_spec.rb +19 -0
- data/spec/models/blacklight/search_builder_spec.rb +1 -11
- data/spec/models/blacklight/solr/default_filter_query_builder_spec.rb +72 -0
- data/spec/models/blacklight/solr/document_spec.rb +0 -4
- data/spec/models/blacklight/solr/facet_search_builder_behavior_spec.rb +929 -0
- data/spec/models/blacklight/solr/repository_spec.rb +31 -29
- data/spec/models/blacklight/solr/request_spec.rb +7 -0
- data/spec/models/blacklight/solr/response/facets_spec.rb +86 -40
- data/spec/models/blacklight/solr/response/group_response_spec.rb +8 -5
- data/spec/models/blacklight/solr/response/group_spec.rb +9 -5
- data/spec/models/blacklight/solr/response_spec.rb +96 -64
- data/spec/models/blacklight/solr/search_builder_behavior_spec.rb +2 -227
- data/spec/models/solr_document_spec.rb +5 -1
- data/spec/services/blacklight/search_service_spec.rb +5 -26
- data/spec/spec_helper.rb +0 -1
- data/spec/support/view_component_test_helpers.rb +0 -18
- data/spec/views/catalog/facet.html.erb_spec.rb +10 -11
- data/spec/views/catalog/index.atom.builder_spec.rb +6 -3
- data/spec/views/catalog/index.html.erb_spec.rb +8 -3
- data/spec/views/catalog/show.html.erb_spec.rb +1 -0
- data/tasks/blacklight.rake +8 -5
- metadata +76 -81
- data/app/assets/stylesheets/blacklight/_autocomplete.scss +0 -25
- data/app/assets/stylesheets/blacklight/_mixins.scss +0 -20
- data/app/components/blacklight/facet_field_list_component.html.erb +0 -19
- data/app/components/blacklight/icons/legacy_icon_component.rb +0 -30
- data/app/components/blacklight/search/facet_suggest_input.html.erb +0 -12
- data/app/components/blacklight/search/facet_suggest_input.rb +0 -20
- data/app/javascript/blacklight/index.js +0 -18
- data/app/javascript/blacklight/modalForm.js +0 -60
- data/app/views/catalog/_constraints.html.erb +0 -1
- data/app/views/catalog/_facet_index_navigation.html.erb +0 -1
- data/app/views/catalog/_facet_layout.html.erb +0 -8
- data/app/views/catalog/_facet_pagination.html.erb +0 -1
- data/app/views/catalog/_facets.html.erb +0 -5
- data/app/views/catalog/_search_form.html.erb +0 -7
- data/app/views/catalog/_search_header.html.erb +0 -1
- data/app/views/catalog/_show_sidebar.html.erb +0 -3
- data/app/views/catalog/_show_tools.html.erb +0 -2
- data/app/views/catalog/_start_over.html.erb +0 -1
- data/app/views/shared/_header_navbar.html.erb +0 -1
- data/lib/generators/blacklight/assets/sprockets_generator.rb +0 -68
- data/spec/components/blacklight/document_metadata_component_spec.rb +0 -0
- data/spec/components/blacklight/search/facet_suggest_input_spec.rb +0 -57
- data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +0 -43
- data/spec/views/catalog/_facet_layout.html.erb_spec.rb +0 -41
- data/spec/views/catalog/_search_header.erb_spec.rb +0 -14
- data/spec/views/catalog/_show_sidebar.erb_spec.rb +0 -24
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +0 -37
- /data/app/components/blacklight/{facet_field_checkboxes_component.html.erb → facets/checkboxes_component.html.erb} +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/button_focus.js +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/debounce.js +0 -0
- /data/app/javascript/{blacklight → blacklight-frontend}/search_context.js +0 -0
@@ -5,7 +5,7 @@ require 'spec_helper'
|
|
5
5
|
RSpec.describe Blacklight::ConstraintsComponent, type: :component do
|
6
6
|
subject(:component) { described_class.new(**params) }
|
7
7
|
|
8
|
-
|
8
|
+
before { render_inline(component) }
|
9
9
|
|
10
10
|
let(:params) do
|
11
11
|
{ search_state: search_state }
|
@@ -32,19 +32,19 @@ RSpec.describe Blacklight::ConstraintsComponent, type: :component do
|
|
32
32
|
let(:query_params) { { q: 'some query' } }
|
33
33
|
|
34
34
|
it 'renders a start-over link' do
|
35
|
-
expect(
|
35
|
+
expect(page).to have_link 'Start Over', href: '/catalog'
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'has a header' do
|
39
|
-
expect(
|
39
|
+
expect(page).to have_css('h2', text: 'Search Constraints')
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'wraps the output in a div' do
|
43
|
-
expect(
|
43
|
+
expect(page).to have_css('div#appliedParams')
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'renders the query' do
|
47
|
-
expect(
|
47
|
+
expect(page).to have_css('.applied-filter.constraint', text: 'some query')
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -52,15 +52,15 @@ RSpec.describe Blacklight::ConstraintsComponent, type: :component do
|
|
52
52
|
let(:query_params) { { f: { some_facet: ['some value'] } } }
|
53
53
|
|
54
54
|
it 'renders the query' do
|
55
|
-
expect(
|
55
|
+
expect(page).to have_css('.constraint-value > .filter-name', text: 'Some Facet').and(have_css('.constraint-value > .filter-value', text: 'some value'))
|
56
56
|
end
|
57
57
|
|
58
58
|
context 'that is not configured' do
|
59
59
|
let(:query_params) { { f: { some_facet: ['some value'], missing: ['another value'] } } }
|
60
60
|
|
61
61
|
it 'renders only the configured constraints' do
|
62
|
-
expect(
|
63
|
-
expect(
|
62
|
+
expect(page).to have_css('.constraint-value > .filter-name', text: 'Some Facet').and(have_css('.constraint-value > .filter-value', text: 'some value'))
|
63
|
+
expect(page).to have_no_css('.constraint-value > .filter-name', text: 'Missing')
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -71,15 +71,15 @@ RSpec.describe Blacklight::ConstraintsComponent, type: :component do
|
|
71
71
|
let(:query_params) { { q: 'some query', f: { some_facet: ['some value'] } } }
|
72
72
|
|
73
73
|
it 'wraps the output in a span' do
|
74
|
-
expect(
|
74
|
+
expect(page).to have_css('span .constraint')
|
75
75
|
end
|
76
76
|
|
77
77
|
it 'renders the search state as lightly-decorated text' do
|
78
|
-
expect(
|
78
|
+
expect(page).to have_css('.constraint > .filter-values', text: 'some query').and(have_css('.constraint', text: 'Some Facet:some value'))
|
79
79
|
end
|
80
80
|
|
81
81
|
it 'omits the headers' do
|
82
|
-
expect(
|
82
|
+
expect(page).to have_no_css('h2', text: 'Search Constraints')
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|
@@ -6,39 +6,43 @@ RSpec.describe Blacklight::Document::ActionComponent, type: :component do
|
|
6
6
|
subject(:component) { described_class.new(document: document, action: action, **attr) }
|
7
7
|
|
8
8
|
let(:action) { Blacklight::Configuration::ToolConfig.new(key: 'some_tool', name: 'some_tool', component: true) }
|
9
|
-
let(:attr) { {} }
|
10
|
-
let(:view_context) { controller.view_context }
|
11
|
-
let(:render) do
|
12
|
-
component.render_in(view_context)
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:rendered) do
|
16
|
-
Capybara::Node::Simple.new(render)
|
17
|
-
end
|
18
|
-
|
19
9
|
let(:document) do
|
20
10
|
SolrDocument.new(
|
21
11
|
id: 'x'
|
22
12
|
)
|
23
13
|
end
|
14
|
+
let(:attr) { {} }
|
15
|
+
let(:view_context) { vc_test_controller.view_context }
|
16
|
+
|
17
|
+
before do
|
18
|
+
# Every call to view_context returns a different object. This ensures it stays stable.
|
19
|
+
allow(vc_test_controller).to receive_messages(view_context: view_context)
|
20
|
+
end
|
24
21
|
|
25
|
-
|
26
|
-
|
22
|
+
context 'with a configured path' do
|
23
|
+
before do
|
27
24
|
allow(view_context).to receive(:some_tool_solr_document_path).with(document, { only_path: true }).and_return('/asdf')
|
28
|
-
|
29
|
-
|
25
|
+
|
26
|
+
render_inline component
|
30
27
|
end
|
31
28
|
|
32
|
-
|
29
|
+
it 'renders an action link' do
|
30
|
+
expect(page).to have_link 'Some tool', href: '/asdf'
|
31
|
+
end
|
33
32
|
end
|
34
33
|
|
35
34
|
context 'with a partial configured' do
|
36
35
|
let(:action) { Blacklight::Configuration::ToolConfig.new(name: '', partial: '/some/tool') }
|
37
36
|
|
38
|
-
|
37
|
+
before do
|
38
|
+
allow(view_context).to receive(:render).and_call_original
|
39
39
|
allow(view_context).to receive(:render).with(hash_including(partial: '/some/tool'), {}).and_return('tool')
|
40
40
|
|
41
|
-
|
41
|
+
render_inline component
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'render the partial' do
|
45
|
+
expect(page).to have_content 'tool'
|
42
46
|
end
|
43
47
|
end
|
44
48
|
end
|
@@ -6,40 +6,35 @@ RSpec.describe Blacklight::Document::GroupComponent, type: :component do
|
|
6
6
|
subject(:component) { described_class.new(group: group, **attr) }
|
7
7
|
|
8
8
|
let(:attr) { {} }
|
9
|
-
let(:view_context) {
|
10
|
-
let(:
|
11
|
-
component.render_in(view_context)
|
12
|
-
end
|
13
|
-
|
14
|
-
let(:rendered) do
|
15
|
-
Capybara::Node::Simple.new(render)
|
16
|
-
end
|
17
|
-
|
18
|
-
let(:docs) { 10.times.map { double } }
|
9
|
+
let(:view_context) { vc_test_controller.view_context }
|
10
|
+
let(:docs) { 10.times.map { SolrDocument.new } }
|
19
11
|
|
20
12
|
let(:group) do
|
21
13
|
instance_double(Blacklight::Solr::Response::Group, key: 'group1', field: 'group_field', total: 15, docs: docs)
|
22
14
|
end
|
23
15
|
|
24
16
|
before do
|
17
|
+
# Every call to view_context returns a different object. This ensures it stays stable.
|
18
|
+
allow(vc_test_controller).to receive_messages(view_context: view_context)
|
25
19
|
allow(view_context).to receive(:render_document_index).with(docs).and_return('results')
|
20
|
+
render_inline component
|
26
21
|
end
|
27
22
|
|
28
23
|
it 'renders the group with a header' do
|
29
|
-
expect(
|
30
|
-
expect(
|
31
|
-
expect(
|
24
|
+
expect(page).to have_css 'div.group'
|
25
|
+
expect(page).to have_css 'h2', text: 'group1'
|
26
|
+
expect(page).to have_no_link 'more'
|
32
27
|
end
|
33
28
|
|
34
29
|
it 'renders the group documents' do
|
35
|
-
expect(
|
30
|
+
expect(page).to have_content 'results'
|
36
31
|
end
|
37
32
|
|
38
33
|
context 'with a limit applied' do
|
39
34
|
let(:attr) { { group_limit: 5 } }
|
40
35
|
|
41
36
|
it 'renders a control to see more results' do
|
42
|
-
expect(
|
37
|
+
expect(page).to have_link 'more'
|
43
38
|
end
|
44
39
|
end
|
45
40
|
end
|
@@ -7,14 +7,7 @@ RSpec.describe Blacklight::Document::PageHeaderComponent, type: :component do
|
|
7
7
|
|
8
8
|
let(:show_header_tools_component) { Class.new(Blacklight::Document::ShowToolsComponent) }
|
9
9
|
|
10
|
-
let(:view_context) {
|
11
|
-
let(:render) do
|
12
|
-
component.render_in(view_context)
|
13
|
-
end
|
14
|
-
|
15
|
-
let(:rendered) do
|
16
|
-
Capybara::Node::Simple.new(render)
|
17
|
-
end
|
10
|
+
let(:view_context) { vc_test_controller.view_context }
|
18
11
|
|
19
12
|
let(:document) { SolrDocument.new(id: 'x', title_tsim: 'Title') }
|
20
13
|
|
@@ -25,16 +18,16 @@ RSpec.describe Blacklight::Document::PageHeaderComponent, type: :component do
|
|
25
18
|
# rubocop:disable RSpec/SubjectStub
|
26
19
|
before do
|
27
20
|
# Every call to view_context returns a different object. This ensures it stays stable.
|
28
|
-
allow(
|
29
|
-
allow(
|
30
|
-
|
31
|
-
allow(
|
21
|
+
allow(vc_test_controller).to receive_messages(view_context: view_context, blacklight_config: blacklight_config)
|
22
|
+
allow(vc_test_controller).to receive(:current_search_session).and_return(double(id: document.id))
|
23
|
+
vc_test_controller.class.helper_method :current_search_session
|
24
|
+
allow(vc_test_controller).to receive_messages(controller_name: 'catalog', link_to_previous_document: '', link_to_next_document: '')
|
32
25
|
allow(view_context).to receive_messages(search_context: search_context, search_session: current_search_session, current_search_session: current_search_session)
|
33
26
|
allow(component).to receive(:render).and_call_original
|
34
27
|
allow(component).to receive(:render).with(an_instance_of(show_header_tools_component)).and_return('tool component content')
|
35
28
|
replace_hash = { 'application/_start_over.html.erb' => 'Start Over' }
|
36
29
|
if Rails.version.to_f >= 7.1
|
37
|
-
|
30
|
+
vc_test_controller.prepend_view_path(RSpec::Rails::ViewExampleGroup::StubResolverCache.resolver_for(replace_hash))
|
38
31
|
else
|
39
32
|
view_context.view_paths.unshift(RSpec::Rails::ViewExampleGroup::StubResolverCache.resolver_for(replace_hash))
|
40
33
|
end
|
@@ -45,18 +38,25 @@ RSpec.describe Blacklight::Document::PageHeaderComponent, type: :component do
|
|
45
38
|
let(:search_context) { nil }
|
46
39
|
let(:current_search_session) { {} }
|
47
40
|
|
48
|
-
|
49
|
-
|
41
|
+
context 'with no header tools' do
|
42
|
+
before do
|
43
|
+
render_inline component
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'does not render' do
|
47
|
+
expect(page.native.inner_html).to be_blank
|
48
|
+
end
|
50
49
|
end
|
51
50
|
|
52
51
|
context 'has header tools' do
|
53
52
|
before do
|
54
53
|
blacklight_config.show.show_header_tools_component = show_header_tools_component
|
54
|
+
render_inline component
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'renders the tools' do
|
58
|
-
expect(
|
59
|
-
expect(
|
58
|
+
expect(page).to have_text 'tool component content'
|
59
|
+
expect(page).to have_css '.row'
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -67,25 +67,32 @@ RSpec.describe Blacklight::Document::PageHeaderComponent, type: :component do
|
|
67
67
|
let(:next_doc) { SolrDocument.new(id: '888') }
|
68
68
|
let(:current_search_session) { { query_params: { q: 'abc' }, 'id' => '123', 'document_id' => document.id } }
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
context 'with no header tools' do
|
71
|
+
before do
|
72
|
+
render_inline component
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'renders pagination' do
|
76
|
+
expect(page).to have_text 'Previous'
|
77
|
+
expect(page).to have_text 'Next'
|
78
|
+
expect(page).to have_text 'Start Over'
|
79
|
+
expect(page).to have_text 'Back to Search'
|
80
|
+
end
|
75
81
|
end
|
76
82
|
|
77
83
|
context 'has header tools' do
|
78
84
|
before do
|
79
85
|
blacklight_config.show.show_header_tools_component = show_header_tools_component
|
86
|
+
render_inline component
|
80
87
|
end
|
81
88
|
|
82
89
|
it 'renders the tools and pagination' do
|
83
|
-
expect(
|
84
|
-
expect(
|
85
|
-
expect(
|
86
|
-
expect(
|
87
|
-
expect(
|
88
|
-
expect(
|
90
|
+
expect(page).to have_text 'Previous'
|
91
|
+
expect(page).to have_text 'Next'
|
92
|
+
expect(page).to have_text 'Start Over'
|
93
|
+
expect(page).to have_text 'Back to Search'
|
94
|
+
expect(page).to have_text 'tool component content'
|
95
|
+
expect(page).to have_css '.row'
|
89
96
|
end
|
90
97
|
end
|
91
98
|
end
|
@@ -5,14 +5,7 @@ require 'spec_helper'
|
|
5
5
|
RSpec.describe Blacklight::Document::SidebarComponent, type: :component do
|
6
6
|
subject(:component) { described_class.new(presenter: document) }
|
7
7
|
|
8
|
-
let(:view_context) {
|
9
|
-
let(:render) do
|
10
|
-
component.render_in(view_context)
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:rendered) do
|
14
|
-
Capybara::Node::Simple.new(render)
|
15
|
-
end
|
8
|
+
let(:view_context) { vc_test_controller.view_context }
|
16
9
|
|
17
10
|
let(:document) { view_context.document_presenter(presented_document) }
|
18
11
|
|
@@ -26,37 +19,23 @@ RSpec.describe Blacklight::Document::SidebarComponent, type: :component do
|
|
26
19
|
|
27
20
|
before do
|
28
21
|
# Every call to view_context returns a different object. This ensures it stays stable.
|
29
|
-
allow(
|
22
|
+
allow(vc_test_controller).to receive_messages(view_context: view_context, blacklight_config: blacklight_config)
|
30
23
|
end
|
31
24
|
|
32
25
|
describe '#render_show_tools' do
|
33
26
|
# rubocop:disable RSpec/SubjectStub
|
34
27
|
before do
|
35
28
|
allow(component).to receive(:render).with(an_instance_of(Blacklight::Document::MoreLikeThisComponent)).and_return("")
|
29
|
+
blacklight_config.show.show_tools_component = show_tools_component
|
30
|
+
allow(component).to receive(:render).with(an_instance_of(show_tools_component)).and_return(expected_html)
|
31
|
+
render_inline component
|
36
32
|
end
|
33
|
+
# rubocop:enable RSpec/SubjectStub
|
37
34
|
|
38
|
-
|
39
|
-
before do
|
40
|
-
allow(component).to receive(:render).with('show_tools', document: presented_document, silence_deprecation: false).and_return(expected_html)
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'renders show_tools partial' do
|
44
|
-
expect(rendered).to have_css 'div[@class="expected-show_tools"]'
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
context "with a configured ShowTools component" do
|
49
|
-
let(:show_tools_component) { Class.new(Blacklight::Document::ShowToolsComponent) }
|
50
|
-
|
51
|
-
before do
|
52
|
-
blacklight_config.show.show_tools_component = show_tools_component
|
53
|
-
allow(component).to receive(:render).with(an_instance_of(show_tools_component)).and_return(expected_html)
|
54
|
-
end
|
35
|
+
let(:show_tools_component) { Class.new(Blacklight::Document::ShowToolsComponent) }
|
55
36
|
|
56
|
-
|
57
|
-
|
58
|
-
end
|
37
|
+
it 'renders configured show_tools component' do
|
38
|
+
expect(page).to have_css 'div[@class="expected-show_tools"]'
|
59
39
|
end
|
60
|
-
# rubocop:enable RSpec/SubjectStub
|
61
40
|
end
|
62
41
|
end
|
@@ -6,14 +6,7 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
6
6
|
subject(:component) { described_class.new(document: document, **attr) }
|
7
7
|
|
8
8
|
let(:attr) { {} }
|
9
|
-
let(:view_context) {
|
10
|
-
let(:render) do
|
11
|
-
component.render_in(view_context)
|
12
|
-
end
|
13
|
-
|
14
|
-
let(:rendered) do
|
15
|
-
Capybara::Node::Simple.new(render)
|
16
|
-
end
|
9
|
+
let(:view_context) { vc_test_controller.view_context }
|
17
10
|
|
18
11
|
let(:document) { view_context.document_presenter(presented_document) }
|
19
12
|
|
@@ -36,7 +29,7 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
36
29
|
|
37
30
|
before do
|
38
31
|
# Every call to view_context returns a different object. This ensures it stays stable.
|
39
|
-
allow(
|
32
|
+
allow(vc_test_controller).to receive_messages(view_context: view_context, current_or_guest_user: User.new, blacklight_config: blacklight_config)
|
40
33
|
allow(view_context).to receive_messages(search_session: {}, current_search_session: nil, current_bookmarks: [])
|
41
34
|
end
|
42
35
|
|
@@ -46,78 +39,92 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
46
39
|
component.set_slot(:metadata, nil, 'Metadata')
|
47
40
|
component.set_slot(:thumbnail, nil, 'Thumbnail')
|
48
41
|
component.set_slot(:actions) { 'Actions' }
|
42
|
+
render_inline component
|
49
43
|
|
50
|
-
expect(
|
51
|
-
expect(
|
52
|
-
expect(
|
53
|
-
expect(
|
54
|
-
expect(
|
44
|
+
expect(page).to have_content 'Title'
|
45
|
+
expect(page).to have_content 'Embed'
|
46
|
+
expect(page).to have_content 'Metadata'
|
47
|
+
expect(page).to have_content 'Thumbnail'
|
48
|
+
expect(page).to have_content 'Actions'
|
55
49
|
end
|
56
50
|
|
57
51
|
it 'has schema.org properties' do
|
58
52
|
component.set_slot(:body) { '-' }
|
53
|
+
render_inline component
|
59
54
|
|
60
|
-
expect(
|
61
|
-
expect(
|
55
|
+
expect(page).to have_css 'article[@itemtype="http://schema.org/Thing"]'
|
56
|
+
expect(page).to have_css 'article[@itemscope]'
|
62
57
|
end
|
63
58
|
|
64
59
|
context 'with a provided body' do
|
65
60
|
it 'opts-out of normal component content' do
|
66
61
|
component.set_slot(:body) { 'Body content' }
|
62
|
+
render_inline component
|
67
63
|
|
68
|
-
expect(
|
69
|
-
expect(
|
70
|
-
expect(
|
64
|
+
expect(page).to have_content 'Body content'
|
65
|
+
expect(page).to have_no_css 'header'
|
66
|
+
expect(page).to have_no_css 'dl'
|
71
67
|
end
|
72
68
|
end
|
73
69
|
|
74
70
|
context 'index view' do
|
75
71
|
before do
|
76
|
-
|
72
|
+
vc_test_controller.action_name = "index"
|
77
73
|
end
|
78
74
|
|
79
75
|
let(:attr) { { counter: 5 } }
|
80
76
|
|
81
77
|
it 'has data properties' do
|
82
78
|
component.set_slot(:body) { '-' }
|
79
|
+
render_inline component
|
83
80
|
|
84
|
-
expect(
|
85
|
-
expect(
|
81
|
+
expect(page).to have_css 'article[@data-document-id="x"]'
|
82
|
+
expect(page).to have_css 'article[@data-document-counter="5"]'
|
86
83
|
end
|
87
84
|
|
88
85
|
it 'renders a linked title' do
|
89
|
-
|
86
|
+
render_inline component
|
87
|
+
|
88
|
+
expect(page).to have_link 'Title', href: '/catalog/x'
|
90
89
|
end
|
91
90
|
|
92
91
|
it 'renders a counter with the title' do
|
93
|
-
|
92
|
+
render_inline component
|
93
|
+
|
94
|
+
expect(page).to have_css 'header', text: '5. Title'
|
94
95
|
end
|
95
96
|
|
96
97
|
context 'with a document rendered as part of a collection' do
|
97
|
-
|
98
|
-
let(:document_counter) { ViewComponent::VERSION::MAJOR < 3 ? 11 : 10 }
|
98
|
+
let(:document_counter) { 10 }
|
99
99
|
let(:attr) { { document_counter: document_counter, counter_offset: 100 } }
|
100
100
|
|
101
101
|
it 'renders a counter with the title' do
|
102
|
-
|
103
|
-
|
102
|
+
render_inline component
|
103
|
+
|
104
|
+
expect(page).to have_css 'header', text: '111. Title'
|
104
105
|
end
|
105
106
|
end
|
106
107
|
|
107
108
|
it 'renders actions' do
|
108
|
-
|
109
|
+
render_inline component
|
110
|
+
|
111
|
+
expect(page).to have_css '.index-document-functions'
|
109
112
|
end
|
110
113
|
|
111
114
|
it 'renders a thumbnail' do
|
112
|
-
|
115
|
+
render_inline component
|
116
|
+
|
117
|
+
expect(page).to have_css 'a[href="/catalog/x"] img[src="http://example.com/image.jpg"]'
|
113
118
|
end
|
114
119
|
|
115
120
|
context 'with default metadata component' do
|
116
121
|
it 'renders metadata' do
|
117
|
-
|
118
|
-
|
119
|
-
expect(
|
120
|
-
expect(
|
122
|
+
render_inline component
|
123
|
+
|
124
|
+
expect(page).to have_css 'dl.document-metadata'
|
125
|
+
expect(page).to have_css 'dt', text: 'Title:'
|
126
|
+
expect(page).to have_css 'dd', text: 'Title'
|
127
|
+
expect(page).to have_no_css 'dt', text: 'ISBN:'
|
121
128
|
end
|
122
129
|
end
|
123
130
|
end
|
@@ -126,44 +133,58 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
126
133
|
let(:attr) { { title_component: :h1, show: true } }
|
127
134
|
|
128
135
|
before do
|
129
|
-
|
136
|
+
vc_test_controller.action_name = "show"
|
130
137
|
end
|
131
138
|
|
132
139
|
it 'renders with an id' do
|
133
140
|
component.set_slot(:body) { '-' }
|
141
|
+
render_inline component
|
134
142
|
|
135
|
-
expect(
|
143
|
+
expect(page).to have_css 'article#document'
|
136
144
|
end
|
137
145
|
|
138
146
|
it 'renders a title' do
|
139
|
-
|
147
|
+
render_inline component
|
148
|
+
|
149
|
+
expect(page).to have_css 'h1', text: 'Title'
|
140
150
|
end
|
141
151
|
|
142
152
|
it 'renders with show-specific metadata' do
|
143
|
-
|
144
|
-
|
145
|
-
expect(
|
153
|
+
render_inline component
|
154
|
+
|
155
|
+
expect(page).to have_css 'dl.document-metadata'
|
156
|
+
expect(page).to have_css 'dt', text: 'ISBN:'
|
157
|
+
expect(page).to have_css 'dd', text: 'Value'
|
146
158
|
end
|
147
159
|
|
148
|
-
|
149
|
-
|
150
|
-
|
160
|
+
context 'with an embed component' do
|
161
|
+
before do
|
162
|
+
vc_test_controller.action_name = "show"
|
151
163
|
|
152
|
-
|
153
|
-
|
154
|
-
end
|
155
|
-
end)
|
164
|
+
stub_const('StubComponent', Class.new(ViewComponent::Base) do
|
165
|
+
def initialize(**); end
|
156
166
|
|
157
|
-
|
158
|
-
|
167
|
+
def call
|
168
|
+
'embed'.html_safe
|
169
|
+
end
|
170
|
+
end)
|
171
|
+
|
172
|
+
blacklight_config.show.embed_component = StubComponent
|
173
|
+
render_inline component
|
174
|
+
end
|
175
|
+
|
176
|
+
it 'renders an embed' do
|
177
|
+
expect(page).to have_content 'embed'
|
178
|
+
end
|
159
179
|
end
|
160
180
|
|
161
181
|
context 'show view with custom translation' do
|
162
182
|
let!(:original_translations) { I18n.backend.send(:translations).deep_dup }
|
163
183
|
|
164
184
|
before do
|
165
|
-
|
185
|
+
vc_test_controller.action_name = "show"
|
166
186
|
I18n.backend.store_translations(:en, blacklight: { search: { show: { label: "testing:%{label}" } } })
|
187
|
+
render_inline component
|
167
188
|
end
|
168
189
|
|
169
190
|
after do
|
@@ -172,9 +193,9 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
172
193
|
end
|
173
194
|
|
174
195
|
it 'renders with show-specific metadata with correct translation' do
|
175
|
-
expect(
|
176
|
-
expect(
|
177
|
-
expect(
|
196
|
+
expect(page).to have_css 'dl.document-metadata'
|
197
|
+
expect(page).to have_css 'dt', text: 'testing:ISBN'
|
198
|
+
expect(page).to have_css 'dd', text: 'Value'
|
178
199
|
end
|
179
200
|
end
|
180
201
|
|
@@ -191,10 +212,11 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
191
212
|
before do
|
192
213
|
stub_const('MyMetadataComponent', custom_component_class)
|
193
214
|
blacklight_config.show.metadata_component = MyMetadataComponent
|
215
|
+
render_inline component
|
194
216
|
end
|
195
217
|
|
196
218
|
it 'renders custom component' do
|
197
|
-
expect(
|
219
|
+
expect(page).to have_text 'blah'
|
198
220
|
end
|
199
221
|
end
|
200
222
|
|
@@ -211,36 +233,47 @@ RSpec.describe Blacklight::DocumentComponent, type: :component do
|
|
211
233
|
before do
|
212
234
|
stub_const('MyTitleComponent', custom_component_class)
|
213
235
|
blacklight_config.show.title_component = MyTitleComponent
|
236
|
+
render_inline component
|
214
237
|
end
|
215
238
|
|
216
239
|
it 'renders custom component' do
|
217
|
-
expect(
|
240
|
+
expect(page).to have_text 'Titleriffic'
|
218
241
|
end
|
219
242
|
end
|
220
243
|
end
|
221
244
|
|
222
|
-
|
223
|
-
|
224
|
-
|
245
|
+
context 'with partials' do
|
246
|
+
before do
|
247
|
+
component.with_partial { 'Partials' }
|
248
|
+
render_inline component
|
249
|
+
end
|
250
|
+
|
251
|
+
it 'renders partials' do
|
252
|
+
expect(page).to have_content 'Partials'
|
253
|
+
end
|
225
254
|
end
|
226
255
|
|
227
|
-
|
228
|
-
|
256
|
+
context 'with no partials (default behavior)' do
|
257
|
+
before do
|
258
|
+
render_inline component
|
259
|
+
end
|
229
260
|
|
230
|
-
|
261
|
+
it 'has no partials by default' do
|
262
|
+
expect(component.partials?).to be false
|
263
|
+
end
|
231
264
|
end
|
232
265
|
|
233
266
|
context 'with before_titles' do
|
234
|
-
|
235
|
-
component
|
236
|
-
|
267
|
+
before do
|
268
|
+
render_inline(component) do |inner_c|
|
269
|
+
inner_c.with_title do |c|
|
237
270
|
c.with_before_title { 'Prefix!' }
|
238
271
|
end
|
239
272
|
end
|
240
273
|
end
|
241
274
|
|
242
275
|
it 'shows the prefix' do
|
243
|
-
expect(
|
276
|
+
expect(page).to have_content "Prefix!"
|
244
277
|
end
|
245
278
|
end
|
246
279
|
end
|