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