Skip to content

Commit

Permalink
chore: make all the service names used in the service_unlink tests th…
Browse files Browse the repository at this point in the history
…e same
  • Loading branch information
Jose Diaz-Gonzalez committed Feb 21, 2023
1 parent 43dad86 commit e1c357e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/service_unlink.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ load test_helper

setup() {
dokku apps:create my-app
dokku "$PLUGIN_COMMAND_PREFIX:create" l
dokku "$PLUGIN_COMMAND_PREFIX:create" ls
}

teardown() {
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls
dokku --force apps:destroy my-app
}

Expand All @@ -17,12 +17,12 @@ teardown() {
}

@test "($PLUGIN_COMMAND_PREFIX:unlink) error when the app argument is missing" {
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls
assert_contains "${lines[*]}" "Please specify an app to run the command on"
}

@test "($PLUGIN_COMMAND_PREFIX:unlink) error when the app does not exist" {
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l not_existing_app
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls not_existing_app
assert_contains "${lines[*]}" "App not_existing_app does not exist"
}

Expand All @@ -32,22 +32,22 @@ teardown() {
}

@test "($PLUGIN_COMMAND_PREFIX:unlink) error when service not linked to app" {
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
assert_contains "${lines[*]}" "Not linked to app my-app"
}

@test "($PLUGIN_COMMAND_PREFIX:unlink) removes link from docker-options" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app

check_value="Docker options build: Docker options deploy: --restart=on-failure:10 Docker options run:"
options=$(dokku --quiet docker-options:report my-app | xargs)
assert_equal "$options" "$check_value"
}

@test "($PLUGIN_COMMAND_PREFIX:unlink) unsets config url from app" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
config=$(dokku config:get my-app STATSD_URL || true)
assert_equal "$config" ""
}

0 comments on commit e1c357e

Please sign in to comment.