#1955: Add user_id to tag test fixtures to fix tests

This commit is contained in:
Jyri-Petteri Paloposki 2019-06-27 15:58:12 +03:00
parent f6d1f243c5
commit 6b54962388
2 changed files with 8 additions and 5 deletions

View file

@ -10,18 +10,21 @@ end
foo:
id: 1
name: foo
user_id: 1
created_at: <%= today %>
updated_at: <%= today %>
bar:
id: 2
name: bar
user_id: 1
created_at: <%= today %>
updated_at: <%= today %>
baz:
id: 3
name: baz
user_id: 1
created_at: <%= today %>
updated_at: <%= today %>

View file

@ -25,20 +25,20 @@ class TagTest < ActiveSupport::TestCase
tag = Tag.where(:name => "8.1.2").first_or_create
assert !tag.new_record?
end
def test_tag_name_always_lowercase
tag = Tag.where(:name => "UPPER").first_or_create
assert !tag.new_record?
upper = Tag.where(:name => "upper").first
assert_not_nil upper
assert upper.name == "upper"
end
def test_tag_name_stripped_of_spaces
tag = Tag.where(:name => " strip spaces ").first_or_create
assert !tag.new_record?
assert tag.name == "strip spaces"
end