@@ -13,19 +13,15 @@ def test_assigns_in_current_locale
13
13
def test_retrieves_in_current_locale
14
14
p = Post . new (
15
15
:title_translations => { "en" => "English Title" , "fr" => "Titre français" } ,
16
- :body_1_translations => { "en" => "English Body" , "fr" => "Corps anglais " }
16
+ :body_1_translations => { "en" => "English Body" , "fr" => "Corps français " }
17
17
)
18
18
I18n . with_locale ( :fr ) do
19
19
assert_equal ( "Titre français" , p . title )
20
- assert_equal ( "Corps anglais " , p . body_1 )
20
+ assert_equal ( "Corps français " , p . body_1 )
21
21
end
22
22
end
23
23
24
24
def test_retrieves_in_current_locale_with_fallbacks
25
- I18n ::Backend ::Simple . include ( I18n ::Backend ::Fallbacks )
26
- I18n . default_locale = :"en-US"
27
- I18n . fallbacks = I18n ::Locale ::Fallbacks . new ( fr : :"en-US" )
28
-
29
25
p = Post . new ( :title_translations => { "en" => "English Title" } , :body_1_translations => { "en" => "English Body" } )
30
26
I18n . with_locale ( :fr ) do
31
27
assert_equal ( "English Title" , p . title )
@@ -90,10 +86,6 @@ def test_retrieves_in_specified_locale
90
86
end
91
87
92
88
def test_retrieves_in_specified_locale_with_fallbacks
93
- I18n ::Backend ::Simple . include ( I18n ::Backend ::Fallbacks )
94
- I18n . default_locale = :"en-US"
95
- I18n . fallbacks = I18n ::Locale ::Fallbacks . new ( fr : :"en-US" )
96
-
97
89
p = Post . new ( :title_translations => { "en" => "English Title" } , :body_1_translations => { "en" => "English Body" } )
98
90
I18n . with_locale ( :fr ) do
99
91
assert_equal ( "English Title" , p . title )
@@ -106,10 +98,6 @@ def test_retrieves_in_specified_locale_with_fallbacks
106
98
end
107
99
108
100
def test_fallback_from_empty_string
109
- I18n ::Backend ::Simple . include ( I18n ::Backend ::Fallbacks )
110
- I18n . default_locale = :"en-US"
111
- I18n . fallbacks = I18n ::Locale ::Fallbacks . new ( fr : :"en-US" )
112
-
113
101
p = Post . new ( :title_translations => { "en" => "English Title" , "fr" => "" } , :body_1_translations => { "en" => "English Body" , "fr" => "" } )
114
102
I18n . with_locale ( :fr ) do
115
103
assert_equal ( "English Title" , p . title )
@@ -122,10 +110,6 @@ def test_fallback_from_empty_string
122
110
end
123
111
124
112
def test_retrieves_in_specified_locale_with_fallback_disabled
125
- I18n ::Backend ::Simple . include ( I18n ::Backend ::Fallbacks )
126
- I18n . default_locale = :"en-US"
127
- I18n . fallbacks = I18n ::Locale ::Fallbacks . new ( fr : :"en-US" )
128
-
129
113
p = Post . new ( :title_translations => { "en" => "English Title" } , :body_1_translations => { "en" => "English Body" } )
130
114
p . disable_fallback
131
115
I18n . with_locale ( :fr ) do
@@ -135,10 +119,6 @@ def test_retrieves_in_specified_locale_with_fallback_disabled
135
119
end
136
120
137
121
def test_retrieves_in_specified_locale_with_fallback_disabled_using_a_block
138
- I18n ::Backend ::Simple . include ( I18n ::Backend ::Fallbacks )
139
- I18n . default_locale = :"en-US"
140
- I18n . fallbacks = I18n ::Locale ::Fallbacks . new ( fr : :"en-US" )
141
-
142
122
p = Post . new ( :title_translations => { "en" => "English Title" } , :body_1_translations => { "en" => "English Body" } )
143
123
p . enable_fallback
144
124
@@ -163,10 +143,6 @@ def test_retrieves_in_specified_locale_with_fallback_disabled_using_a_block
163
143
end
164
144
165
145
def test_retrieves_in_specified_locale_with_fallback_reenabled
166
- I18n ::Backend ::Simple . include ( I18n ::Backend ::Fallbacks )
167
- I18n . default_locale = :"en-US"
168
- I18n . fallbacks = I18n ::Locale ::Fallbacks . new ( fr : :"en-US" )
169
-
170
146
p = Post . new ( :title_translations => { "en" => "English Title" } , :body_1_translations => { "en" => "English Body" } )
171
147
p . disable_fallback
172
148
p . enable_fallback
@@ -181,10 +157,6 @@ def test_retrieves_in_specified_locale_with_fallback_reenabled
181
157
end
182
158
183
159
def test_retrieves_in_specified_locale_with_fallback_reenabled_using_a_block
184
- I18n ::Backend ::Simple . include ( I18n ::Backend ::Fallbacks )
185
- I18n . default_locale = :"en-US"
186
- I18n . fallbacks = I18n ::Locale ::Fallbacks . new ( fr : :"en-US" )
187
-
188
160
p = Post . new ( :title_translations => { "en" => "English Title" } , :body_1_translations => { "en" => "English Body" } )
189
161
p . disable_fallback
190
162
0 commit comments