Sha256: 6f51058054b45a69d4c1de0f1aa2c3ce80db883af41187c4fcd6c2761b1d8302

Contents?: true

Size: 833 Bytes

Versions: 7

Compression:

Stored size: 833 Bytes

Contents

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

describe TagsHelper do
  before(:each) do
    clean_database!
    
    @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 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

7 entries across 7 versions & 3 rubygems

Version Path
acts-as-taggable-on-1.1.9 spec/acts_as_taggable_on/tags_helper_spec.rb
acts-as-taggable-on-1.1.8 spec/acts_as_taggable_on/tags_helper_spec.rb
acts-as-taggable-on-simonwh-2.0.0.pre1 spec/acts_as_taggable_on/tags_helper_spec.rb
simonwh-acts-as-taggable-on-2.0.0.pre1 spec/acts_as_taggable_on/tags_helper_spec.rb
acts-as-taggable-on-1.1.7 spec/acts_as_taggable_on/tags_helper_spec.rb
acts-as-taggable-on-2.0.0.pre1 spec/acts_as_taggable_on/tags_helper_spec.rb
acts-as-taggable-on-1.1.6 spec/acts_as_taggable_on/tags_helper_spec.rb