test/unit/router_tests.rb in deas-0.41.0 vs test/unit/router_tests.rb in deas-0.42.0
- old
+ new
@@ -400,9 +400,30 @@
assert_raises ArgumentError do
subject.url(:get_info, /^\/info/)
end
end
+ should "complain if defining a url with invalid splats" do
+ assert_raises ArgumentError do
+ subject.url(:get_info, "/something/*/other/*")
+ end
+ assert_raises ArgumentError do
+ subject.url(:get_info, "/something/*/other")
+ end
+ assert_raises ArgumentError do
+ subject.url(:get_info, "/something/*/")
+ end
+ assert_raises ArgumentError do
+ subject.url(:get_info, "/*/something")
+ end
+ assert_nothing_raised do
+ subject.url(:get_info, "/something/*")
+ end
+ assert_nothing_raised do
+ subject.url(:get_info, "/*")
+ end
+ end
+
should "build a path for a url given params" do
exp_path = subject.prepend_base_url("/info/now")
assert_equal exp_path, subject.url_for(:get_info, :for => 'now')
end