Sha256: ac06a94f7cd695e5090dac42df96df6e4aef414704e1d7f4a27817b73e571478

Contents?: true

Size: 630 Bytes

Versions: 18

Compression:

Stored size: 630 Bytes

Contents

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

describe Tag do
  before(:each) do
    @tag = Tag.new
    @user = TaggableModel.create(:name => "Pablo")  
  end
  
  it "should require a name" do
    @tag.valid?
    @tag.errors.on(:name).should == "can't be blank"
    @tag.name = "something"
    @tag.valid?
    @tag.errors.on(:name).should be_nil
  end
  
  it "should equal a tag with the same name" do
    @tag.name = "awesome"
    new_tag = Tag.new(:name => "awesome")
    new_tag.should == @tag
  end
  
  it "should return its name when to_s is called" do
    @tag.name = "cool"
    @tag.to_s.should == "cool"
  end
end

Version data entries

18 entries across 18 versions & 7 rubygems

Version Path
slillibri-acts-as-taggable-on-1.0.5 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-1.0.12 spec/acts_as_taggable_on/tag_spec.rb
di-acts-as-taggable-1.0.3 spec/acts_as_taggable_on/tag_spec.rb
di-acts-as-taggable-1.0.2 spec/acts_as_taggable_on/tag_spec.rb
di-acts-as-taggable-1.0.1 spec/acts_as_taggable_on/tag_spec.rb
di-acts-as-taggable-1.0 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-1.0.11 spec/acts_as_taggable_on/tag_spec.rb
ordered-tags-0.0.1 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-for-domains-0.1.1 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-1.0.10 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-1.0.9 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-for-domains-0.1.0 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-1.0.8 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-1.0.7 spec/acts_as_taggable_on/tag_spec.rb
lwe-acts-as-taggable-on-1.0.7 spec/acts_as_taggable_on/tag_spec.rb
lwe-acts-as-taggable-on-1.0.7.lwe spec/acts_as_taggable_on/tag_spec.rb
jerryvos-acts-as-taggable-on-1.0.6 spec/acts_as_taggable_on/tag_spec.rb
acts-as-taggable-on-1.0.6 spec/acts_as_taggable_on/tag_spec.rb