Add tests for posts route
This commit is contained in:
parent
831a86c738
commit
7b8413ae57
@ -23,7 +23,7 @@ http {
|
||||
|
||||
# redirect requests ending in a forward slash
|
||||
location ~ ^/(.+)/$ {
|
||||
return 302 /$1;
|
||||
return 301 /$1;
|
||||
}
|
||||
|
||||
location /css {
|
||||
|
@ -48,3 +48,17 @@ describe "http://miti.sh/index.html", ->
|
||||
assert.same request\statusCode!, 200
|
||||
assert.same request\statusMessage!, "OK"
|
||||
assert.same request\body!\match("<title>(.*)</title>"), index_title
|
||||
|
||||
describe "http://miti.sh/posts/", ->
|
||||
it "permanently redirects to http://miti.sh/posts", ->
|
||||
request = req "http://miti.sh/posts/"
|
||||
assert.same request\statusCode!, 301
|
||||
assert.same request\statusMessage!, "Moved Permanently"
|
||||
assert.same request\header!.Location, "http://miti.sh/posts"
|
||||
|
||||
describe "http://miti.sh/posts", ->
|
||||
it "sends /posts/index.html", ->
|
||||
request = req "http://miti.sh/posts"
|
||||
assert.same request\statusCode!, 200
|
||||
assert.same request\statusMessage!, "OK"
|
||||
assert.same request\body!\match("<title>(.*)</title>"), "miti.sh · Posts"
|
||||
|
Loading…
x
Reference in New Issue
Block a user