3 class TracetagTest < ActiveSupport::TestCase
6 tracetag_valid({ :tag => nil }, :valid => false)
7 tracetag_valid({ :tag => "" }, :valid => false)
8 tracetag_valid({ :tag => "a" })
9 tracetag_valid({ :tag => "a" * 255 })
10 tracetag_valid({ :tag => "a" * 256 }, :valid => false)
11 tracetag_valid({ :tag => "a/b" }, :valid => false)
12 tracetag_valid({ :tag => "a;b" }, :valid => false)
13 tracetag_valid({ :tag => "a.b" }, :valid => false)
14 tracetag_valid({ :tag => "a,b" }, :valid => false)
15 tracetag_valid({ :tag => "a?b" }, :valid => false)
20 def tracetag_valid(attrs, valid: true)
21 entry = build(:tracetag)
22 entry.assign_attributes(attrs)
23 assert_equal valid, entry.valid?, "Expected #{attrs.inspect} to be #{valid}"