Defect #14206 » lang.diff
app/views/layouts/base.html.erb | ||
---|---|---|
1 | 1 |
<!DOCTYPE html> |
2 |
<html lang="en">
|
|
2 |
<html lang=<%= current_language %>>
|
|
3 | 3 |
<head> |
4 | 4 |
<meta charset="utf-8" /> |
5 | 5 |
<title><%=h html_title %></title> |
test/integration/application_test.rb | ||
---|---|---|
36 | 36 |
assert_response :success |
37 | 37 |
assert_tag :tag => 'h2', :content => 'Projets' |
38 | 38 |
assert_equal :fr, current_language |
39 |
assert_select "html[lang=?]", "fr" |
|
39 | 40 | |
40 | 41 |
# then an italien user |
41 | 42 |
get 'projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'it;q=0.8,en-us;q=0.5,en;q=0.3' |
42 | 43 |
assert_response :success |
43 | 44 |
assert_tag :tag => 'h2', :content => 'Progetti' |
44 | 45 |
assert_equal :it, current_language |
46 |
assert_select "html[lang=?]", "it" |
|
45 | 47 | |
46 | 48 |
# not a supported language: default language should be used |
47 | 49 |
get 'projects', { }, 'HTTP_ACCEPT_LANGUAGE' => 'zz' |
48 | 50 |
assert_response :success |
49 | 51 |
assert_tag :tag => 'h2', :content => 'Projects' |
52 |
assert_select "html[lang=?]", "en" |
|
50 | 53 |
end |
51 | 54 | |
52 | 55 |
def test_token_based_access_should_not_start_session |