mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-06 16:01:47 +01:00
Override #to_s on Tag for simplified joining
This commit is contained in:
parent
01b7f78f3c
commit
0b733b6183
3 changed files with 11 additions and 2 deletions
|
|
@ -45,5 +45,10 @@ class TagTest < ActiveSupport::TestCase
|
|||
def test_tag_label
|
||||
assert_equal 'one-two-three', Tag.new(:name => 'one two three').label
|
||||
end
|
||||
|
||||
|
||||
def test_tag_as_string
|
||||
tags = [Tag.new(:name => 'tag1'), Tag.new(:name => 'tag2')]
|
||||
assert_equal 'tag1, tag2', tags.join(', ')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue