From 073f745677aad07d6829ea72cb78e15f8ec2073c Mon Sep 17 00:00:00 2001 From: Matthew Kent Date: Sat, 11 Nov 2023 12:57:52 -0800 Subject: [PATCH] Test for both undefined roles and missing traefik. --- test/configuration_test.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 63e1de4a0..00612f24a 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -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