X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f2d13c075660efb9582d7fb600bd6798d7a382ca..34e3e51456774127d43408b7ab65c24f41373f62:/test/models/relation_tag_test.rb?ds=sidebyside diff --git a/test/models/relation_tag_test.rb b/test/models/relation_tag_test.rb index 0b5bedb05..ea095574c 100644 --- a/test/models/relation_tag_test.rb +++ b/test/models/relation_tag_test.rb @@ -2,11 +2,11 @@ require 'test_helper' class RelationTagTest < ActiveSupport::TestCase api_fixtures - + def test_relation_tag_count assert_equal 9, RelationTag.count end - + def test_length_key_valid key = "k" (0..255).each do |i| @@ -17,7 +17,7 @@ class RelationTagTest < ActiveSupport::TestCase assert tag.valid? end end - + def test_length_value_valid val = "v" (0..255).each do |i| @@ -28,7 +28,7 @@ class RelationTagTest < ActiveSupport::TestCase assert tag.valid? end end - + def test_length_key_invalid ["k"*256].each do |i| tag = RelationTag.new @@ -39,7 +39,7 @@ class RelationTagTest < ActiveSupport::TestCase assert tag.errors[:k].any? end end - + def test_length_value_invalid ["v"*256].each do |i| tag = RelationTag.new @@ -50,13 +50,13 @@ class RelationTagTest < ActiveSupport::TestCase assert tag.errors[:v].any? end end - + def test_empty_tag_invalid tag = RelationTag.new assert !tag.valid?, "Empty relation tag should be invalid" assert tag.errors[:relation].any? end - + def test_uniquness tag = RelationTag.new tag.relation_id = current_relation_tags(:t1).relation_id @@ -70,12 +70,12 @@ class RelationTagTest < ActiveSupport::TestCase ## # test that tags can be updated and saved uniquely, i.e: tag.save! - # only affects the single tag that the activerecord object + # only affects the single tag that the activerecord object # represents. this amounts to testing that the primary key is # unique. # # Commenting this out - I attempted to fix it, but composite primary keys - # wasn't playing nice with the column already called :id. Seemed to be + # wasn't playing nice with the column already called :id. Seemed to be # impossible to have validations on the :id column. If someone knows better # please fix, otherwise this test is shelved. #