def test_changeset_tag_count
assert_equal 2, ChangesetTag.count
end
-
+
def test_length_key_valid
key = "k"
(0..255).each do |i|
assert tag.valid?
end
end
-
+
def test_length_value_valid
val = "v"
(0..255).each do |i|
assert tag.valid?
end
end
-
+
def test_length_key_invalid
["k"*256].each do |k|
tag = ChangesetTag.new
assert tag.errors[:k].any?
end
end
-
+
def test_length_value_invalid
["v"*256].each do |v|
tag = ChangesetTag.new
assert tag.errors[:v].any?
end
end
-
+
def test_empty_tag_invalid
tag = ChangesetTag.new
assert !tag.valid?, "Empty tag should be invalid"
assert tag.errors[:changeset].any?
end
-
+
def test_uniqueness
tag = ChangesetTag.new
tag.changeset_id = changeset_tags(:changeset_1_tag_1).changeset_id