Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed that default locale templates should be used if the current loc…
…ale template is missing [DHH]
- Loading branch information
Showing
5 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
require 'abstract_unit' | |||
|
|||
class LocalizedController < ActionController::Base | |||
def hello_world | |||
end | |||
end | |||
|
|||
class LocalizedTemplatesTest < ActionController::TestCase | |||
tests LocalizedController | |||
|
|||
def test_localized_template_is_used | |||
I18n.locale = :de | |||
get :hello_world | |||
assert_equal "Gutten Tag", @response.body | |||
end | |||
|
|||
def test_default_locale_template_is_used_when_locale_is_missing | |||
I18n.locale = :dk | |||
get :hello_world | |||
assert_equal "Hello World", @response.body | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
Gutten Tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
Hello World |