]> git.openstreetmap.org Git - rails.git/blob - test/helpers/title_helper_test.rb
Don't disable search submission buttons on form submission
[rails.git] / test / helpers / title_helper_test.rb
1 # coding: utf-8
2
3 require "test_helper"
4
5 class TitleHelperTest < ActionView::TestCase
6   def test_set_title
7     set_title
8     assert_equal "OpenStreetMap", response.header["X-Page-Title"]
9     assert_nil @title
10
11     set_title(nil)
12     assert_equal "OpenStreetMap", response.header["X-Page-Title"]
13     assert_nil @title
14
15     set_title("Test Title")
16     assert_equal "OpenStreetMap%20%7C%20Test%20Title", response.header["X-Page-Title"]
17     assert_equal "Test Title", @title
18
19     set_title("Test & Title")
20     assert_equal "OpenStreetMap%20%7C%20Test%20&%20Title", response.header["X-Page-Title"]
21     assert_equal "Test & Title", @title
22
23     set_title("Tést & Tïtlè")
24     assert_equal "OpenStreetMap%20%7C%20T%C3%A9st%20&%20T%C3%AFtl%C3%A8", response.header["X-Page-Title"]
25     assert_equal "Tést & Tïtlè", @title
26   end
27 end