From aacc4bbc44b4d8c9a26e170c1d733344788fb769 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 31 May 2017 16:49:17 +0100 Subject: [PATCH] Refactor changeset tags model test to remove dependency on fixtures. --- test/models/changeset_tag_test.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/models/changeset_tag_test.rb b/test/models/changeset_tag_test.rb index 90a8518b4..030614a1e 100644 --- a/test/models/changeset_tag_test.rb +++ b/test/models/changeset_tag_test.rb @@ -1,13 +1,13 @@ require "test_helper" class ChangesetTagTest < ActiveSupport::TestCase - api_fixtures - def test_length_key_valid + changeset = create(:changeset) + key = "k" (0..255).each do |i| tag = ChangesetTag.new - tag.changeset_id = 1 + tag.changeset_id = changeset.id tag.k = key * i tag.v = "v" assert tag.valid? @@ -15,10 +15,12 @@ class ChangesetTagTest < ActiveSupport::TestCase end def test_length_value_valid + changeset = create(:changeset) + val = "v" (0..255).each do |i| tag = ChangesetTag.new - tag.changeset_id = 1 + tag.changeset_id = changeset.id tag.k = "k" tag.v = val * i assert tag.valid? -- 2.39.5