Sha256: 4c296a76d08dd1d7f2bb5b69519ae1d7bb112be9dbf0fb23aadab5f7d2e0ea8c
Contents?: true
Size: 724 Bytes
Versions: 13
Compression:
Stored size: 724 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe Tagging do before(:each) do @tagging = Tagging.new end it "should not be valid with a invalid tag" do @tagging.taggable = TaggableModel.create(:name => "Bob Jones") @tagging.tag = Tag.new(:name => "") @tagging.context = "tags" @tagging.should_not be_valid @tagging.errors.on(:tag_id).should == "can't be blank" end it "should not create duplicate taggings" do @taggable = TaggableModel.create(:name => "Bob Jones") @tag = Tag.create(:name => "awesome") lambda { 2.times { Tagging.create(:taggable => @taggable, :tag => @tag, :context => 'tags') } }.should change(Tagging, :count).by(1) end end
Version data entries
13 entries across 13 versions & 2 rubygems