Sha256: 29a1a6491904aedd6c1cbe065978abc89e250e7d9e3f3c61718400ad07fe274b

Contents?: true

Size: 853 Bytes

Versions: 26

Compression:

Stored size: 853 Bytes

Contents

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

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

  def test_from
    assert_equal %w(one two three), RedmineCrm::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

26 entries across 26 versions & 1 rubygems

Version Path
redmine_crm-0.0.63 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.62 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.61 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.60 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.59 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.58 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.57 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.56 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.55 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.54 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.53 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.52 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.51 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.50 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.49 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.48 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.47 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.46 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.45 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.44 test/acts_as_taggable/tag_list_test.rb