Sha256: 55b67f07f46db3f2184254499cf4f1710bab436cf399a58460cc7df7232fbefb

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe ActsAsTaggableOnPadrino::TagsHelper do
  before(:each) do
    @bob = TaggableModel.create(:name => "Bob Jones",  :language_list => "ruby, php")
    @tom = TaggableModel.create(:name => "Tom Marley", :language_list => "ruby, java")
    @eve = TaggableModel.create(:name => "Eve Nodd",   :language_list => "ruby, c++")
    
    @helper = class Helper
      include ActsAsTaggableOnPadrino::TagsHelper
    end.new
  end
  
  it "should yield the proper css classes" do 
    tags = { }
    
    @helper.tag_cloud(TaggableModel.tag_counts_on(:languages), ["sucky", "awesome"]) do |tag, css_class|
      tags[tag.name] = css_class
    end
    
    tags["ruby"].should == "awesome"
    tags["java"].should == "sucky"
    tags["c++"].should == "sucky"
    tags["php"].should == "sucky"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-taggable-on-padrino-0.1.2 spec/acts_as_taggable_on_padrino/tags_helper_spec.rb