@coder ||= HTMLEntities.new
end
- def set_title(title = false)
+ def set_title(title = nil)
if title
@title = TitleHelper.coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
response.headers["X-Page-Title"] = URI.escape(t("layouts.project_name.title") + " | " + @title)
class TitleHelperTest < ActionView::TestCase
def test_set_title
+ set_title
+ assert_equal "OpenStreetMap", response.header["X-Page-Title"]
+ assert_nil @title
+
set_title(nil)
assert_equal "OpenStreetMap", response.header["X-Page-Title"]
assert_nil @title