- ["v"*256].each do |i|
- tag = RelationTag.new
- tag.relation_id = 1
- tag.k = "k"
- tag.v = i
- assert !tag.valid?, "Value #{i} should be too long"
- assert tag.errors[:v].any?
- end
+ tag = create(:relation_tag)
+ tag.v = "v" * 256
+ assert_not tag.valid?, "Value should be too long"
+ assert tag.errors[:v].any?