@@ -149,8 +149,10 @@ def url_for(opts)
149
149
routes . send ( :not_about_path ) . should == "/not_about"
150
150
end
151
151
152
- it "of named_routes (another format)" do
153
- routes . send ( :not_about2_path ) . should == "/not_about2"
152
+ if rails3?
153
+ it "of named_routes (another format)" do
154
+ routes . send ( :not_about2_path ) . should == "/not_about2"
155
+ end
154
156
end
155
157
156
158
it "of a singular resource" do
@@ -171,8 +173,10 @@ def url_for(opts)
171
173
172
174
it "named_route uses default values" do
173
175
routes . send ( :about_path ) . should == "/about"
174
- routes . send ( :about2_path ) . should == "/about2"
175
- routes . send ( :main_path ) . should == "/home"
176
+ if rails3?
177
+ routes . send ( :about2_path ) . should == "/about2"
178
+ routes . send ( :main_path ) . should == "/home"
179
+ end
176
180
routes . send ( :welcome_path ) . should == '/welcome/to/our/page'
177
181
end
178
182
@@ -230,8 +234,10 @@ def url_for(opts)
230
234
231
235
it "named_route generates route using localized values" do
232
236
routes . send ( :about_path ) . should == "/#{ I18n . t :about , :scope => :named_routes_path } "
233
- routes . send ( :about2_path ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
234
- routes . send ( :main_path ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
237
+ if rails3?
238
+ routes . send ( :about2_path ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
239
+ routes . send ( :main_path ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
240
+ end
235
241
end
236
242
237
243
@@ -258,8 +264,10 @@ def url_for(opts)
258
264
o = I18n . locale
259
265
I18n . locale = "fr"
260
266
routes . send ( :about_path ) . should == "/#{ I18n . t :about , :scope => :named_routes_path } "
261
- routes . send ( :about2_path ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
262
- routes . send ( :main_path ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
267
+ if rails3?
268
+ routes . send ( :about2_path ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
269
+ routes . send ( :main_path ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
270
+ end
263
271
I18n . locale = o
264
272
end
265
273
@@ -275,8 +283,10 @@ def url_for(opts)
275
283
it "url_for generates routes using localized values" do
276
284
url_for ( :controller => :users ) . should == "/#{ I18n . t :as , :scope => :'routes.users' } "
277
285
url_for ( :controller => :about , :action => :show ) . should == "/#{ I18n . t :about , :scope => :named_routes_path } "
278
- url_for ( :controller => :about2 , :action => :show ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
279
- url_for ( :controller => :pages , :action => :home ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
286
+ if rails3?
287
+ url_for ( :controller => :about2 , :action => :show ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
288
+ url_for ( :controller => :pages , :action => :home ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
289
+ end
280
290
end
281
291
282
292
if !rails3?
@@ -430,8 +440,10 @@ def url_for(opts)
430
440
431
441
it "named_route generates route using localized values" do
432
442
routes . send ( :about_path ) . should == "/#{ I18n . t :about , :scope => :named_routes_path } "
433
- routes . send ( :about2_path ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
434
- routes . send ( :main_path ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
443
+ if rails3?
444
+ routes . send ( :about2_path ) . should == "/#{ I18n . t :about2 , :scope => :named_routes_path } "
445
+ routes . send ( :main_path ) . should == "/#{ I18n . t :home , :scope => :named_routes_path } "
446
+ end
435
447
end
436
448
437
449
it "custom translated path names" do
0 commit comments