Sha256: f363a99e704508850b2d2b241aae8240e583531d5ff64e89c83e70f113e0eb5d

Contents?: true

Size: 947 Bytes

Versions: 8

Compression:

Stored size: 947 Bytes

Contents

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

# module Redmineup
  class TagsHelperTest < ActiveSupport::TestCase
    include Redmineup::TagsHelper

    def test_tag_cloud
      cloud_elements = []

      tag_cloud Issue.tag_counts, %w(css1 css2 css3 css4) do |tag, css_class|
        cloud_elements << [tag, css_class]
      end
      assert cloud_elements.include?([tags(:error), "css4"])
      assert cloud_elements.include?([tags(:question), "css4"])
      assert cloud_elements.include?([tags(:bug), "css2"])
      assert cloud_elements.include?([tags(:feature), "css2"])
      assert_equal 4, cloud_elements.size
    end

    # def test_tag_cloud_when_no_tags
    #   cloud_elements = []
    #   tag_cloud SpecialIssue.tag_counts, %w(css1) do |tag, css_class|
    #     # assert false, "tag_cloud should not yield"
    #     cloud_elements << [tag, css_class]
    #   end
    #   assert_equal 0, cloud_elements.size
    # end
  end
# end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
redmineup-1.0.10 test/tags_helper_test.rb
redmineup-1.0.9 test/tags_helper_test.rb
redmineup-1.0.8 test/tags_helper_test.rb
redmineup-1.0.7 test/tags_helper_test.rb
redmineup-1.0.5 test/tags_helper_test.rb
redmineup-1.0.4 test/tags_helper_test.rb
redmineup-1.0.3 test/tags_helper_test.rb
redmineup-1.0.2 test/tags_helper_test.rb