Skip to content

Instantly share code, notes, and snippets.

@revelation
Created August 22, 2008 03:55
Show Gist options
  • Save revelation/6735 to your computer and use it in GitHub Desktop.
Save revelation/6735 to your computer and use it in GitHub Desktop.
require File.join(File.dirname(__FILE__), "spec_helper")
describe Merb::Router do
describe "#match" do
it "should raise an error if the routes were not compiled yet" do
lambda { Merb::Router.match(simple_request) }.should raise_error(Merb::Router::NotCompiledError)
end
it "should choose the correct route when multiple routes are defined" do
Merb::Router.prepare do |r|
r.match("/denver").to(:controller => "one")
r.match("/houston").to(:controller => "two")
end
route_to("/denver").should have_route(:controller => "one")
route_to("/houston").should_not have_route(:controller => "one")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment