From 3e0a3f20a79330f1f152a5f3667b29cb904d959c Mon Sep 17 00:00:00 2001 From: Gibheer Date: Tue, 10 Sep 2013 08:56:24 +0200 Subject: allow a dash in the middle url part --- spec/unit/zero/router/call_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/unit') diff --git a/spec/unit/zero/router/call_spec.rb b/spec/unit/zero/router/call_spec.rb index 923b747..835d51d 100644 --- a/spec/unit/zero/router/call_spec.rb +++ b/spec/unit/zero/router/call_spec.rb @@ -103,4 +103,17 @@ describe Zero::Router, '#call' do it_behaves_like "a sample app" end + + context 'with a dash in the variable' do + let(:routes) { {'/:id' => app} } + let(:env) { EnvGenerator.get('/foo-bar') } + let(:app) do + lambda do |env| + [200, content_type, [Zero::Request.new(env).params['id']]] + end + end + let(:result) { ['foo-bar'] } + + it_behaves_like "a sample app" + end end -- cgit v1.2.3-70-g09d2