Skip to content

Commit

Permalink
Fix variable scope of context boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgds committed Nov 18, 2021
1 parent f73b11f commit 7fe87b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/views/content_items/_context_and_title.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<% context_string = t("content_item.schema_name.#{@content_item.document_type}", count: 1) %>
<%
context_string = t("content_item.schema_name.#{@content_item.document_type}", count: 1);
context_inside = false;
%>

<% @content_item&.featured_attachments.each do |fa| %>
<% return if !@content_item.attachment_details(fa).present? %>
Expand All @@ -17,7 +20,7 @@
<%= render 'govuk_publishing_components/components/title',
context: context_string,
context_locale: t_locale_fallback("content_item.schema_name.#{@content_item.document_type}", count: 1),
context_inside: context_inside ||= false,
context_inside: context_inside,
title: @content_item.title,
average_title_length: "long"
%>
1 change: 1 addition & 0 deletions test/views/content_items/attachments.html.erb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ class ContentItemsAttachmentsTest < ActionView::TestCase
)

assert_includes rendered, "Correspondence overview:"
assert_select "h1 span"
end
end

0 comments on commit 7fe87b3

Please sign in to comment.