Sha256: fd5050a807c1830c4e8d6e6ef880782b61a41d56d45f182ff838178b756adeaa

Contents?: true

Size: 763 Bytes

Versions: 4

Compression:

Stored size: 763 Bytes

Contents

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

class TagsHelperTest < ActiveSupport::TestCase
  include TagsHelper
  
  def test_tag_cloud
    cloud_elements = []
    
    tag_cloud Post.tag_counts, %w(css1 css2 css3 css4) do |tag, css_class|
      cloud_elements << [tag, css_class]
    end
    
    assert cloud_elements.include?([tags(:good), "css2"])
    assert cloud_elements.include?([tags(:bad), "css1"])
    assert cloud_elements.include?([tags(:nature), "css4"])
    assert cloud_elements.include?([tags(:question), "css1"])
    assert_equal 4, cloud_elements.size
  end
  
  def test_tag_cloud_when_no_tags
    tag_cloud SpecialPost.tag_counts, %w(css1) do
      assert false, "tag_cloud should not yield"
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
jviney-acts_as_taggable_on_steroids-1.0 test/tags_helper_test.rb
jviney-acts_as_taggable_on_steroids-1.1 test/tags_helper_test.rb
acts_as_taggable_on_steroids-1.2 test/tags_helper_test.rb
acts_as_taggable_on_steroids-1.1 test/tags_helper_test.rb