Fix URL error and add test

This commit is contained in:
Domonkos Czinke
2016-07-11 15:41:05 +02:00
committed by Jose Diaz-Gonzalez
parent 5af42dc678
commit 0efb690992
2 changed files with 25 additions and 2 deletions

View File

@@ -22,6 +22,15 @@ assert_urls() {
assert_output < <(tr ' ' '\n' <<< "${urls}" | sort)
}
assert_url() {
url=$1
run dokku url $TEST_APP
echo "output: "$output
echo "status: "$status
echo "url: ${url}"
assert_output < <("${url}")
}
build_nginx_config() {
# simulate nginx post-deploy
dokku domains:setup $TEST_APP
@@ -64,6 +73,15 @@ build_nginx_config() {
assert_urls "http://test.dokku.me" "http://${TEST_APP}.dokku.me" "https://test.dokku.me" "https://${TEST_APP}.dokku.me"
}
@test "(core) url (app ssl)" {
setup_test_tls
assert_url "https://dokku.me"
build_nginx_config
assert_url "https://${TEST_APP}.dokku.me"
add_domain "test.dokku.me"
assert_url "https://test.dokku.me" "https://${TEST_APP}.dokku.me"
}
@test "(core) urls (wildcard ssl)" {
setup_test_tls wildcard
assert_urls "https://dokku.me"