test/path.rb in cuba-3.0.0.rc2 vs test/path.rb in cuba-3.0.0.rc3
- old
+ new
@@ -11,11 +11,11 @@
end
end
_, _, resp = Cuba.call(env)
- assert_equal ["About"], resp.body
+ assert_response resp, ["About"]
end
test "two level nested paths" do |env|
Cuba.define do
on "about" do
@@ -31,17 +31,17 @@
env["PATH_INFO"] = "/about/1"
_, _, resp = Cuba.call(env)
- assert_equal ["+1"], resp.body
+ assert_response resp, ["+1"]
env["PATH_INFO"] = "/about/2"
_, _, resp = Cuba.call(env)
- assert_equal ["+2"], resp.body
+ assert_response resp, ["+2"]
end
test "two level inlined paths" do |env|
Cuba.define do
on "a/b" do
@@ -52,11 +52,11 @@
env["PATH_INFO"] = "/a/b"
_, _, resp = Cuba.call(env)
- assert_equal ["a", "b"], resp.body
+ assert_response resp, ["a", "b"]
end
test "a path with some regex captures" do |env|
Cuba.define do
on "user(\\d+)" do |uid|
@@ -66,11 +66,11 @@
env["PATH_INFO"] = "/user123"
_, _, resp = Cuba.call(env)
- assert_equal ["123"], resp.body
+ assert_response resp, ["123"]
end
test "matching the root" do |env|
Cuba.define do
on "" do
@@ -80,7 +80,7 @@
env["PATH_INFO"] = "/"
_, _, resp = Cuba.call(env)
- assert_equal ["Home"], resp.body
-end
\ No newline at end of file
+ assert_response resp, ["Home"]
+end