]> git.openstreetmap.org Git - rails.git/blob - test/helpers/title_helper_test.rb
Added support for int_ref and _bg, _tx colours for all ref keys
[rails.git] / test / helpers / title_helper_test.rb
1
2 require "test_helper"
3
4 class TitleHelperTest < ActionView::TestCase
5   def test_set_title
6     set_title
7     assert_equal "OpenStreetMap", response.header["X-Page-Title"]
8     assert_nil @title
9
10     set_title(nil)
11     assert_equal "OpenStreetMap", response.header["X-Page-Title"]
12     assert_nil @title
13
14     set_title("Test Title")
15     assert_equal "Test%20Title%20%7C%20OpenStreetMap", response.header["X-Page-Title"]
16     assert_equal "Test Title", @title
17
18     set_title("Test & Title")
19     assert_equal "Test%20%26%20Title%20%7C%20OpenStreetMap", response.header["X-Page-Title"]
20     assert_equal "Test & Title", @title
21
22     set_title("Tést & Tïtlè")
23     assert_equal "T%C3%A9st%20%26%20T%C3%AFtl%C3%A8%20%7C%20OpenStreetMap", response.header["X-Page-Title"]
24     assert_equal "Tést & Tïtlè", @title
25   end
26 end