Browse files

Test utf8 assets filenames with request instead of manifest lookup

  • Loading branch information...
1 parent 9ce03d1 commit b111b41d131fd5d90d88052bb6e95676c29a9d8d @guilleiguaran guilleiguaran committed Oct 8, 2011
Showing with 4 additions and 8 deletions.
  1. +4 −8 railties/test/application/assets_test.rb
@@ -289,20 +289,16 @@ class ::PostsController < ActionController::Base ; end
test "precompile should handle utf8 filenames" do
- if `uname` =~ /Darwin/
- 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.'
- end
filename = "レイルズ.png"
app_file "app/assets/images/#{filename}", "not a image really"
add_to_config "config.assets.precompile = [ /\.png$$/, /application.(css|js)$/ ]"
- assert File.exists?("#{app_path}/public/assets/#{filename}")
+ require "#{app_path}/config/environment"
- manifest = "#{app_path}/public/assets/manifest.yml"
- assets = YAML.load_file(manifest)
- assert_equal filename, assets[filename], assets.inspect
+ get "/assets/#{URI.escape(filename)}"
+ assert_match "not a image really", last_response.body
+ assert File.exists?("#{app_path}/public/assets/#{filename}")
test "assets are cleaned up properly" do

2 comments on commit b111b41

kennyj commented on b111b41 Oct 9, 2011

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

jeremy commented on b111b41 Oct 9, 2011

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

Please sign in to comment.