Files
dokku-mysql/tests/service_create.bats
Jose Diaz-Gonzalez ce916eb846 feat: re-allow dashes in names
This PR allows dashes in service names, while still sanitizing them before they are used as database names. If the datastore is pre-existing, the datatabase name is assumed to be the same as the service name, and returned appropriately.
2019-05-30 17:03:48 -04:00

28 lines
1010 B
Bash
Executable File

#!/usr/bin/env bats
load test_helper
@test "($PLUGIN_COMMAND_PREFIX:create) success" {
run dokku "$PLUGIN_COMMAND_PREFIX:create" l
assert_contains "${lines[*]}" "container created: l"
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l
}
@test "($PLUGIN_COMMAND_PREFIX:create) service with dashes" {
run dokku "$PLUGIN_COMMAND_PREFIX:create" service-with-dashes
assert_contains "${lines[*]}" "container created: service-with-dashes"
assert_contains "${lines[*]}" "dokku-$PLUGIN_COMMAND_PREFIX-service-with-dashes"
assert_contains "${lines[*]}" "service_with_dashes"
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" service-with-dashes
}
@test "($PLUGIN_COMMAND_PREFIX:create) error when there are no arguments" {
run dokku "$PLUGIN_COMMAND_PREFIX:create"
assert_contains "${lines[*]}" "Please specify a valid name for the service"
}
@test "($PLUGIN_COMMAND_PREFIX:create) error when there is an invalid name specified" {
run dokku "$PLUGIN_COMMAND_PREFIX:create" d.erp
assert_failure
}