aboutsummaryrefslogtreecommitdiff
path: root/spec/integration/router_spec.rb
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2012-11-16 10:52:27 +0100
committerGibheer <gibheer@gmail.com>2012-11-16 10:52:27 +0100
commit77e94f58cc171d5d0a6dc6cccf0bf4d98ba5db7d (patch)
tree911dd1d0f326264f0abdf312582f526125f2a944 /spec/integration/router_spec.rb
parenta138da7e848a626aa054d3100f4e6332d3fa84b1 (diff)
delete old specs for router
These specs did not work and are cleanup with the unit specs, so there is no need for them now.
Diffstat (limited to 'spec/integration/router_spec.rb')
-rw-r--r--spec/integration/router_spec.rb55
1 files changed, 0 insertions, 55 deletions
diff --git a/spec/integration/router_spec.rb b/spec/integration/router_spec.rb
deleted file mode 100644
index 4cb55e7..0000000
--- a/spec/integration/router_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'spec_helper'
-
-describe Zero::Router do
- let(:router) { Zero::Router.new(routes) }
- subject { router.call(env) }
-# let(:app) do
-# lambda {|env| [200, {'Content-Type' => 'text/html'}, 'correct'] }
-# end
- let(:app) { double }
- let(:wrong_app) do
- lambda {|env| [200, {'Content-Type' => 'text/html'}, 'Wrong'] }
- end
-
- before :each do
- app.should_receive(:call)
- end
-
- context 'it recognizes root' do
- let(:routes) { { '/' => app } }
- let(:env) { EnvGenerator.get('/') }
- it('handles /') { subject }
- end
-
- context 'a working route' do
- let(:routes) { { '/app' => app } }
- let(:env) { EnvGenerator.get('/app') }
- it('takes a route') { subject }
- end
-
- context 'select the right route' do
- let(:routes) do
- { '/wrong' => wrong_app,
- '/correct' => app }
- end
- let(:env) { EnvGenerator.get('/correct') }
- it("selects the correct from multiple routes") { subject }
- end
-
- context 'uses the deepest path' do
- let(:routes) { { '/wrong' => wrong_app,
- '/deep' => wrong_app,
- '/deep/wrong' => wrong_app,
- '/deep/correct' => app }}
- let(:env) { EnvGenerator.get('/deep/correct') }
- it("finds uses the deepest path first") { subject }
- end
-
- context 'converts parts of the url to parameters' do
- let(:routes) { { '/foo/:id' => app } }
- let(:env) { EnvGenerator.get('/foo/42') }
- it "should extract variables from the url" do
- subject
- end
- end
-end