Permalink
Browse files

unescape path so that we can more easily work with scandinavian lette…

…rs on filters
  • Loading branch information...
1 parent d4e0f1f commit 933013f34e48e6880ccd3782b4e39197e1f5db70 @mseppae committed Jul 28, 2009
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/routing_filter.rb
  2. +5 −0 spec/recognition_spec.rb
View
@@ -51,7 +51,7 @@ def filters
end
def recognize_path_with_filtering(path, env)
- path = path.dup # string is frozen due to memoize
+ path = ::URI.unescape(path.dup) # string is frozen due to memoize
filters.run :around_recognize, path, env, &lambda{ recognize_path_without_filtering(path, env) }
end
alias_method_chain :recognize_path, :filtering
View
@@ -68,4 +68,9 @@
it 'recognizes the path /en-US/sections/1/articles/1 and sets a :locale param' do
should_recognize_path '/en-US/sections/1/articles/1', @article_params.update(:locale => 'en-US')
end
+
+ it 'unescapes the path for the filters' do
+ @set.should_receive(:recognize_path_without_filtering).with('/sections/motörhead', 'test')
+ @set.recognize_path('/sections/mot%C3%B6rhead', 'test')
+ end
end

0 comments on commit 933013f

Please sign in to comment.