3 class LocaleTest < ActionDispatch::IntegrationTest
15 user = users(:second_public_user)
17 post_via_redirect "/login", :username => user.email, :password => "test"
20 assert_equal [], User.find(user.id).languages
21 assert_select "html[lang=?]", "en"
23 get "/diary/new", {}, { "HTTP_ACCEPT_LANGUAGE" => "fr, en" }
24 assert_equal %w(fr en), User.find(user.id).languages
25 assert_select "html[lang=?]", "fr"
29 user = users(:german_user)
32 assert_select "html[lang=?]", "en"
34 get "/diary", :locale => "es"
35 assert_select "html[lang=?]", "es"
37 post_via_redirect "/login", :username => user.email, :password => "test"
40 assert_select "html[lang=?]", "de"
42 get "/diary", :locale => "fr"
43 assert_select "html[lang=?]", "fr"