Sha256: 0400d484fe32868f85781d6a80d2327fd318321ede34e1e4cb558a834ee643be

Contents?: true

Size: 957 Bytes

Versions: 11

Compression:

Stored size: 957 Bytes

Contents

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

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
redmine_crm-0.0.36 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.35 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.34 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.33 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.32 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.31 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.30 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.28 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.27 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.26 test/acts_as_taggable/tag_list_test.rb
redmine_crm-0.0.25 test/acts_as_taggable/tag_list_test.rb