Sha256: 66273ffae1647ad7149861601058f4935f8e7c3a68164271d331238d2387e884

Contents?: true

Size: 686 Bytes

Versions: 7

Compression:

Stored size: 686 Bytes

Contents

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

class TagsHelperTest < Test::Unit::TestCase
  fixtures :tags, :taggings, :posts
  
  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_equal [
      [tags(:good), "css2"],
      [tags(:bad), "css1"],
      [tags(:nature), "css4"],
      [tags(:question), "css1"]
    ], cloud_elements
  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

7 entries across 7 versions & 5 rubygems

Version Path
elight-acts_as_taggable_on_steroids-1.1 test/tags_helper_test.rb
ggoodale-acts_as_taggable_on_steroids-1.1.1 test/tags_helper_test.rb
ggoodale-acts_as_taggable_on_steroids-1.1 test/tags_helper_test.rb
rotuka-taggable-0.0.1 test/tags_helper_test.rb
seamusabshere-acts_as_taggable_on_steroids-1.0 test/tags_helper_test.rb
seamusabshere-acts_as_taggable_on_steroids-1.3 test/tags_helper_test.rb
pictrails-0.5.0 vendor/plugins/acts_as_taggable_on_steroids/test/tags_helper_test.rb