Skip to content

Commit

Permalink
Merge pull request #1570 from alphagov/history-banner-title-from-link…
Browse files Browse the repository at this point in the history
…s-government

Set history banner title from government in the links hash
  • Loading branch information
Bevan authored Dec 4, 2019
2 parents b2e8a7e + fb1d4a9 commit efe4878
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/presenters/content_item/political.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ def historically_political?
end

def publishing_government
content_item["details"]["government"]["title"]
content_item.dig(
"links", "government", 0, "title"
)
end

private
Expand Down
2 changes: 1 addition & 1 deletion test/presenters/publication_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def schema_name
end

test "presents the title of the publishing government" do
assert_equal schema_item["details"]["government"]["title"], presented_item.publishing_government
assert_equal schema_item["links"]["government"][0]["title"], presented_item.publishing_government
end

test "content can be historically political" do
Expand Down

0 comments on commit efe4878

Please sign in to comment.