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