Test for both undefined roles and missing traefik.

This commit is contained in:
Matthew Kent
2023-11-11 12:57:52 -08:00
parent a9cc7c73d2
commit 073f745677

View File

@@ -291,9 +291,16 @@ class ConfigurationTest < ActiveSupport::TestCase
end
test "primary web role no traefik" do
error = assert_raises(ArgumentError) do
Kamal::Configuration.new(@deploy_with_roles.merge(primary_web_role: "workers"))
end
assert_match /workers needs to have traefik enabled/, error.message
end
test "primary web role missing" do
error = assert_raises(ArgumentError) do
Kamal::Configuration.new(@deploy.merge(primary_web_role: "bar"))
end
assert_match /bar/, error.message
assert_match /bar isn't defined/, error.message
end
end