mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
#1955: Add user_id to tag test fixtures to fix tests
This commit is contained in:
parent
f6d1f243c5
commit
6b54962388
2 changed files with 8 additions and 5 deletions
5
test/fixtures/tags.yml
vendored
5
test/fixtures/tags.yml
vendored
|
|
@ -10,18 +10,21 @@ end
|
||||||
foo:
|
foo:
|
||||||
id: 1
|
id: 1
|
||||||
name: foo
|
name: foo
|
||||||
|
user_id: 1
|
||||||
created_at: <%= today %>
|
created_at: <%= today %>
|
||||||
updated_at: <%= today %>
|
updated_at: <%= today %>
|
||||||
|
|
||||||
bar:
|
bar:
|
||||||
id: 2
|
id: 2
|
||||||
name: bar
|
name: bar
|
||||||
|
user_id: 1
|
||||||
created_at: <%= today %>
|
created_at: <%= today %>
|
||||||
updated_at: <%= today %>
|
updated_at: <%= today %>
|
||||||
|
|
||||||
baz:
|
baz:
|
||||||
id: 3
|
id: 3
|
||||||
name: baz
|
name: baz
|
||||||
|
user_id: 1
|
||||||
created_at: <%= today %>
|
created_at: <%= today %>
|
||||||
updated_at: <%= today %>
|
updated_at: <%= today %>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,20 @@ class TagTest < ActiveSupport::TestCase
|
||||||
tag = Tag.where(:name => "8.1.2").first_or_create
|
tag = Tag.where(:name => "8.1.2").first_or_create
|
||||||
assert !tag.new_record?
|
assert !tag.new_record?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_tag_name_always_lowercase
|
def test_tag_name_always_lowercase
|
||||||
tag = Tag.where(:name => "UPPER").first_or_create
|
tag = Tag.where(:name => "UPPER").first_or_create
|
||||||
assert !tag.new_record?
|
assert !tag.new_record?
|
||||||
|
|
||||||
upper = Tag.where(:name => "upper").first
|
upper = Tag.where(:name => "upper").first
|
||||||
assert_not_nil upper
|
assert_not_nil upper
|
||||||
assert upper.name == "upper"
|
assert upper.name == "upper"
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_tag_name_stripped_of_spaces
|
def test_tag_name_stripped_of_spaces
|
||||||
tag = Tag.where(:name => " strip spaces ").first_or_create
|
tag = Tag.where(:name => " strip spaces ").first_or_create
|
||||||
assert !tag.new_record?
|
assert !tag.new_record?
|
||||||
|
|
||||||
assert tag.name == "strip spaces"
|
assert tag.name == "strip spaces"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue