3 class PageLocaleTest < ActionDispatch::IntegrationTest
16 user = users(:second_public_user)
18 post_via_redirect "/login", :username => user.email, :password => "test"
21 assert_equal [], User.find(user.id).languages
22 assert_select "html[lang=?]", "en"
24 get "/diary/new", {}, { "HTTP_ACCEPT_LANGUAGE" => "fr, en" }
25 assert_equal %w(fr en), User.find(user.id).languages
26 assert_select "html[lang=?]", "fr"
30 user = users(:german_user)
33 assert_select "html[lang=?]", "en"
35 get "/diary", :locale => "es"
36 assert_select "html[lang=?]", "es"
38 post_via_redirect "/login", :username => user.email, :password => "test"
41 assert_select "html[lang=?]", "de"
43 get "/diary", :locale => "fr"
44 assert_select "html[lang=?]", "fr"