Created
August 22, 2008 05:15
-
-
Save revelation/6762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should match only if all mixed conditions are satisied" do | |
Merb::Router.prepare do |r| | |
r.match!("/:blog/post/:id", :blog => %r{[a-zA-Z]}, :id => %r{[0-9]}) | |
end | |
route_to("/superblog/post/123").should have_route(:blog => "superblog", :id => "123") | |
route_to("/superblawg/post/321").should have_route(:blog => "superblawg", :id => "321") | |
route_to("/superblog/post/asdf").should have_nil_route | |
route_to("/superblog1/post/123").should have_nil_route | |
route_to("/ab/12").should have_nil_route | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment