Skip to content
This repository
Browse code

Test utf8 assets filenames with request instead of manifest lookup

  • Loading branch information...
commit b111b41d131fd5d90d88052bb6e95676c29a9d8d 1 parent 9ce03d1
Guillermo Iguaran authored October 08, 2011

Showing 1 changed file with 4 additions and 8 deletions. Show diff stats Hide diff stats

  1. 12  railties/test/application/assets_test.rb
12  railties/test/application/assets_test.rb
@@ -289,20 +289,16 @@ class ::PostsController < ActionController::Base ; end
289 289
     end
290 290
 
291 291
     test "precompile should handle utf8 filenames" do
292  
-      if `uname` =~ /Darwin/
293  
-        skip 'Asset lookup with Unicode filenames is a problematic due to different normalization forms. Mac uses NKD for filenames; Windows and Linux use NFC. So your asset lookups may mysteriously fail. Sprockets should handle these platform issues transparently.'
294  
-      end
295  
-
296 292
       filename = "レイルズ.png"
297 293
       app_file "app/assets/images/#{filename}", "not a image really"
298 294
       add_to_config "config.assets.precompile = [ /\.png$$/, /application.(css|js)$/ ]"
299 295
 
300 296
       precompile!
301  
-      assert File.exists?("#{app_path}/public/assets/#{filename}")
  297
+      require "#{app_path}/config/environment"
302 298
 
303  
-      manifest = "#{app_path}/public/assets/manifest.yml"
304  
-      assets = YAML.load_file(manifest)
305  
-      assert_equal filename, assets[filename], assets.inspect
  299
+      get "/assets/#{URI.escape(filename)}"
  300
+      assert_match "not a image really", last_response.body
  301
+      assert File.exists?("#{app_path}/public/assets/#{filename}")
306 302
     end
307 303
 
308 304
     test "assets are cleaned up properly" do

2 notes on commit b111b41

Toshinori Kajihara
Collaborator

@guilleiguaran cool
I realize that ズ (レイルズ's fouth character) 's normalization is different from one another (NFD and NFC) .

Jeremy Kemper
Owner

@kennyj exactly, so it exposes filesystem differences. Tricky one.

Please sign in to comment.
Something went wrong with that request. Please try again.