Add tests for nginx.conf directives #1
@ -44,12 +44,12 @@ http {
|
||||
return 301 http://miti.sh$request_uri;
|
||||
}
|
||||
|
||||
location ~ ^/git/(.*)$ {
|
||||
return 301 https://git.miti.sh/ccm/$1;
|
||||
location ~ ^/git/?(.*)$ {
|
||||
return 301 http://git.miti.sh/ccm/$1;
|
||||
}
|
||||
|
||||
location ~ ^/apps/(.*)$ {
|
||||
return 301 https://apps.miti.sh/$1;
|
||||
return 301 http://apps.miti.sh/$1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,17 +16,24 @@ describe "http://webdevcat.me", ->
|
||||
assert.same request\header!.Location, "http://miti.sh/"
|
||||
|
||||
describe "http://webdevcat.me/git", ->
|
||||
it "permanently redirects to http://git.miti.sh", ->
|
||||
it "permanently redirects to http://git.miti.sh/ccm/", ->
|
||||
request = req "http://webdevcat.me/git"
|
||||
assert.same request\header!.Location, "http://git.miti.sh/"
|
||||
assert.same request\header!.Location, "http://git.miti.sh/ccm/"
|
||||
|
||||
describe "http://webdevcat.me/git/", ->
|
||||
it "permanently redirects to http://git.miti.sh", ->
|
||||
request = req "http://webdevcat.me/git"
|
||||
assert.same request\header!.Location, "http://git.miti.sh/"
|
||||
assert.same request\header!.Location, "http://git.miti.sh/ccm/"
|
||||
|
||||
describe "http://webdevcat.me/git/pandoc/", ->
|
||||
pending "permanently redirects to http://git.miti.sh/ccm/pandoc"
|
||||
describe "http://webdevcat.me/git/pandoc", ->
|
||||
it "permanently redirects to http://git.miti.sh/ccm/pandoc", ->
|
||||
request = req "http://webdevcat.me/git/pandoc"
|
||||
assert.same request\header!.Location, "http://git.miti.sh/ccm/pandoc"
|
||||
|
||||
describe "http://webdevcat.me/apps/btroops", ->
|
||||
it "permanently redirects to http://apps.miti.sh/btroops", ->
|
||||
request = req "http://webdevcat.me/apps/btroops"
|
||||
assert.same request\header!.Location, "http://apps.miti.sh/btroops"
|
||||
|
||||
describe "http://miti.sh", ->
|
||||
it "sends /index.html", ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user