From 77e3b6c47a504b4cb5cefd466396f5913447a030 Mon Sep 17 00:00:00 2001 From: Cameron Dutro Date: Fri, 3 Nov 2023 11:32:23 -0700 Subject: [PATCH] Remove unused test component; add test that verifies methods can start with 'call' (but not 'call_') --- test/sandbox/app/components/header_component.rb | 5 ----- test/sandbox/test/slotable_test.rb | 10 +++++++++- 2 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 test/sandbox/app/components/header_component.rb diff --git a/test/sandbox/app/components/header_component.rb b/test/sandbox/app/components/header_component.rb deleted file mode 100644 index 8a8d8406c..000000000 --- a/test/sandbox/app/components/header_component.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -class HeaderComponent < ViewComponent::Base - renders_one :callout_title -end diff --git a/test/sandbox/test/slotable_test.rb b/test/sandbox/test/slotable_test.rb index dc3c1f6b8..086f418e5 100644 --- a/test/sandbox/test/slotable_test.rb +++ b/test/sandbox/test/slotable_test.rb @@ -720,7 +720,7 @@ def test_slot_with_content_shorthand assert component.title.content? end - def test_slot_names_can_not_start_with_call_ + def test_slot_names_cannot_start_with_call_ assert_raises ViewComponent::InvalidSlotNameError do Class.new(ViewComponent::Base) do renders_one :call_out_title @@ -733,4 +733,12 @@ def test_slot_names_can_not_start_with_call_ end end end + + def test_slot_names_can_start_with_call + assert_nothing_raised do + Class.new(ViewComponent::Base) do + renders_one :callhome_et + end + end + end end