Sha256: 044d24324432299d17d9ec416bfe325f8f246ac99add25e1fdb948cf9924452b
Contents?: true
Size: 946 Bytes
Versions: 44
Compression:
Stored size: 946 Bytes
Contents
require "test_helper" class GovspeakExtractContactContentIdsTest < Minitest::Test test "contact content ids can be extracted from govspeak" do content_id1 = SecureRandom.uuid content_id2 = SecureRandom.uuid govspeak = "Some text with a contact\n [Contact:#{content_id1}]\n\n[Contact:#{content_id2}]" assert_equal(Govspeak::Document.new(govspeak).extract_contact_content_ids, [content_id1, content_id2]) end test "only extracts contact content ids that are UUIDs" do govspeak = "[Contact:12345]" refute_equal( Govspeak::Document.new(govspeak).extract_contact_content_ids, %w[12345], ) end test "same contact repeated multiple times only yields a single result" do content_id = SecureRandom.uuid govspeak = "[Contact:#{content_id}]\n[Contact:#{content_id}][Contact:#{content_id}]" assert_equal(Govspeak::Document.new(govspeak).extract_contact_content_ids, [content_id]) end end
Version data entries
44 entries across 44 versions & 1 rubygems