From 823bbb4b59925f3f55f92659280477566e52a980 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 9 Jul 2025 11:05:44 -0500 Subject: [PATCH] Add tests --- .../public/cards_controller_test.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/controllers/public/cards_controller_test.rb diff --git a/test/controllers/public/cards_controller_test.rb b/test/controllers/public/cards_controller_test.rb new file mode 100644 index 000000000..ed3805367 --- /dev/null +++ b/test/controllers/public/cards_controller_test.rb @@ -0,0 +1,21 @@ +require "test_helper" + +class Public::CardsControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in_as :kevin + @collection = collections(:writebook) + @card = cards(:logo) + @collection.publish + end + + test "show" do + get public_collection_card_path(@collection.publication.key, @card) + assert_response :success + end + + test "not found if the collection is not published" do + @collection.unpublish + get public_collection_card_path(@collection.publication.key, @card) + assert_response :not_found + end +end