diff --git a/app/components/blacklight/document_title_component.html.erb b/app/components/blacklight/document_title_component.html.erb index 1f211d9751..97f729fdbd 100644 --- a/app/components/blacklight/document_title_component.html.erb +++ b/app/components/blacklight/document_title_component.html.erb @@ -1,12 +1,12 @@
<%= content_tag @as, class: @classes do %> - <% before_title.each do |t| %> + <% before_titles.each do |t| %> <%= t %> <% end %> <%= counter -%><%= title -%> - <% after_title.each do |t| %> + <% after_titles.each do |t| %> <%= t %> <% end %> <% end %> diff --git a/app/components/blacklight/document_title_component.rb b/app/components/blacklight/document_title_component.rb index 077e068ce9..9db96c1df6 100644 --- a/app/components/blacklight/document_title_component.rb +++ b/app/components/blacklight/document_title_component.rb @@ -2,8 +2,8 @@ module Blacklight class DocumentTitleComponent < Blacklight::Component - renders_many :before_title - renders_many :after_title + renders_many :before_titles + renders_many :after_titles renders_many :actions # rubocop:disable Metrics/ParameterLists diff --git a/spec/components/blacklight/document_component_spec.rb b/spec/components/blacklight/document_component_spec.rb index dbcd1ae710..bb852d526b 100644 --- a/spec/components/blacklight/document_component_spec.rb +++ b/spec/components/blacklight/document_component_spec.rb @@ -166,4 +166,18 @@ def render_in(view_context) expect(rendered).to have_content 'Thumb!' end end + + context 'with before_title' do + let(:render) do + component.render_in(view_context) do + component.title do |c| + c.before_title { 'Prefix!' } + end + end + end + + it 'shows the prefix' do + expect(rendered).to have_content "Prefix!" + end + end end