Sha256: 53690fede80be14818926e2e52e4c09d2fe1c1e8720df4e0d990f102a96d2acc

Contents?: true

Size: 851 Bytes

Versions: 4

Compression:

Stored size: 851 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class TagListTest < ActiveSupport::TestCase
  def setup
    @tag_list = Redmineup::ActsAsTaggable::TagList.new(%w(error bug))
  end

  def test_from
    assert_equal %w(one two three), Redmineup::ActsAsTaggable::TagList.from('one, two, two, three, three, three')
  end

  def test_add
    @tag_list.add(['new_tag'])
    assert_equal %w(error bug new_tag), @tag_list
  end

  def test_remove
    @tag_list.remove(['old_tag'])
    assert_equal %w(error bug), @tag_list
    @tag_list.remove(['error'])
    assert_equal %w(bug), @tag_list
  end

  def test_toggle
    @tag_list.toggle(['new_tag'])
    assert_equal %w(error bug new_tag), @tag_list
    @tag_list.toggle(['error'])
    assert_equal %w(bug new_tag), @tag_list
  end

  def test_to_s
    assert_equal 'error, bug', @tag_list.to_s
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redmineup-1.0.5 test/acts_as_taggable/tag_list_test.rb
redmineup-1.0.4 test/acts_as_taggable/tag_list_test.rb
redmineup-1.0.3 test/acts_as_taggable/tag_list_test.rb
redmineup-1.0.2 test/acts_as_taggable/tag_list_test.rb