Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…rs on filters
  • Loading branch information...
commit 933013f34e48e6880ccd3782b4e39197e1f5db70 1 parent d4e0f1f
Marko Seppä authored

Showing 2 changed files with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/routing_filter.rb
  2. +5 0 spec/recognition_spec.rb
2  lib/routing_filter.rb
@@ -51,7 +51,7 @@ def filters
51 51 end
52 52
53 53 def recognize_path_with_filtering(path, env)
54   - path = path.dup # string is frozen due to memoize
  54 + path = ::URI.unescape(path.dup) # string is frozen due to memoize
55 55 filters.run :around_recognize, path, env, &lambda{ recognize_path_without_filtering(path, env) }
56 56 end
57 57 alias_method_chain :recognize_path, :filtering
5 spec/recognition_spec.rb
@@ -68,4 +68,9 @@
68 68 it 'recognizes the path /en-US/sections/1/articles/1 and sets a :locale param' do
69 69 should_recognize_path '/en-US/sections/1/articles/1', @article_params.update(:locale => 'en-US')
70 70 end
  71 +
  72 + it 'unescapes the path for the filters' do
  73 + @set.should_receive(:recognize_path_without_filtering).with('/sections/motörhead', 'test')
  74 + @set.recognize_path('/sections/mot%C3%B6rhead', 'test')
  75 + end
71 76 end

0 comments on commit 933013f

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