spec/praxis/router_spec.rb in praxis-0.9 vs spec/praxis/router_spec.rb in praxis-0.10.0
- old
+ new
@@ -70,13 +70,18 @@
context "attributes" do
its(:request_class) {should be(Praxis::Request)}
end
context ".add_route" do
+ before do
+ expect(router).to receive(:warn).with("other conditions not supported yet")
+ end
+
let(:route){ double('route', options: [1], version: 1, verb: 'verb', path: 'path')}
let(:target){ double('target') }
let(:verb_router){ double('verb_router') }
+
it 'wraps the target with a VersionMatcher' do
router.instance_variable_set( :@routes, {'verb'=>verb_router} ) # Ugly, but no need to have a reader
expect(verb_router).to receive(:on) do|path, args|# .with(route.path, call: "foo")
expect(path).to eq(route.path)
expect(args).to be_kind_of(Hash)
@@ -84,10 +89,9 @@
end
router.add_route(target ,route)
end
it "raises warning when options are specified in route" do
- expect(router).to receive(:warn).with("other conditions not supported yet")
expect(router.add_route(proc {'target'},route)).to eq(['path'])
end
end
context ".call" do