test/application_spec.rb in trellis-0.0.4 vs test/application_spec.rb in trellis-0.0.5
- old
+ new
@@ -87,18 +87,33 @@
it "should support a wildcard parameters" do
response = @request.get('/splat/goodbye/cruel/world')
response.body.should == '<html><body>goodbye/cruel/world</body></html>'
end
- it "should supports mixing multiple splat" do
+ it "should supports mixing multiple splats" do
response = @request.get('/splats/bar/foo/bling/baz/boom')
response.body.should == '<html><body>barblingbaz/boom</body></html>'
no_route_response = @request.get('/splats/bar/foo/baz')
no_route_response.status.should be(404)
end
it "should supports mixing named and wildcard params" do
response = @request.get('/mixed/afoo/bar/baz')
response.body.should == '<html><body>bar/baz-afoo</body></html>'
+ end
+
+ it "should merge named params and query string params" do
+ response_mr_bean = @request.get("/hello/Bean?salutation=Mr.%20")
+ response_mr_bean.body.should == "<html><body><h2>Hello</h2>Mr. Bean</body></html>"
+ end
+
+ it "should match a dot ('.') as part of a named param" do
+ response = @request.get("/foobar/user@example.com/thebar")
+ response.body.should == "<html><body>user@example.com-thebar</body></html>"
+ end
+
+ it "should match a literal dot ('.') outside of named params" do
+ response = @request.get("/downloads/logo.gif")
+ response.body.should == "<html><body>logo-gif</body></html>"
end
end
\ No newline at end of file