Sha256: f05fef212d5cfbbf320a039a7f7e1d5298e67f603cbd4b2b351fa0339375ee3f

Contents?: true

Size: 478 Bytes

Versions: 4

Compression:

Stored size: 478 Bytes

Contents

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

describe User do

  describe "A class that is commentable" do
    before do
      @user = Factory(:user)
      @comment = @user.comments.build(:body => 'a test comment')
      @comment.user = @user
      @comment.save!
    end
    
    it "should have comments" do
      @user.comments.length.should == 1
    end
    it "should have comment cache" do
      @user.reload
      @user.comment_count.should == 1
    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
muck-comments-3.0.2 test/rails_test/spec/models/user_spec.rb
muck-activities-3.0.0 test/rails_test/spec/models/user_spec.rb
muck-comments-3.0.1 test/rails_test/spec/models/user_spec.rb
muck-comments-3.0.0 test/rails_test/spec/models/user_spec.rb