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