Sha256: aff61c6f57cc07b164522253e5faf236b23cbda3f5cdffcf9ae5e7a0c7180b4d
Contents?: true
Size: 679 Bytes
Versions: 8
Compression:
Stored size: 679 Bytes
Contents
require File.join(File.dirname(__FILE__), "spec_helper") describe "Deferred routes" do before :each do Merb::Router.prepare do |r| r.match("/deferred/:zoo").defer_to do |request, params| params.merge(:controller => "w00t") if params[:zoo] end r.default_routes end end it "should match routes based on the incoming params" do route_to("/deferred/baz", :boo => "12").should have_route(:controller => "w00t", :zoo => "baz") end it "should fall back to the default route if the deferred condition is not met" do route_to("/deferred").should have_route(:controller => "deferred", :action => "index") end end
Version data entries
8 entries across 8 versions & 3 rubygems