Files
fizzy/test/controllers/public/collections_controller_test.rb
T
2025-09-28 21:11:07 +02:00

30 lines
664 B
Ruby

require "test_helper"
class Public::CollectionsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
collections(:writebook).publish
end
test "show" do
get published_collection_path(collections(:writebook))
assert_response :success
end
test "not found if the collection is not published" do
key = collections(:writebook).publication.key
collections(:writebook).unpublish
get public_collection_path(key)
assert_response :not_found
end
test "show works without authentication" do
sign_out
get published_collection_path(collections(:writebook))
assert_response :success
end
end