Sha256: 3412a4e3a4c336d94f8f89305ff7bf149bc0ea316b4499fc20925a322b061e40

Contents?: true

Size: 596 Bytes

Versions: 9

Compression:

Stored size: 596 Bytes

Contents

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

# Used to test muck_friend_user
class UserTest < ActiveSupport::TestCase

  context "A user that can share" do
    
    should_have_many :shares
    
    setup do
      @user = Factory(:user)
      @share = @user.shares.build(Factory.attributes_for(:share))
      @share.save!
    end
    
    should "have shares" do
      assert_equal 1, @user.shares.length
    end
    # TODO can add the count cache later on if we need it
    # should "have share cache" do
    #   @user.reload
    #   assert_equal 1, @user.share_count
    # end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
muck-shares-0.1.8 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.7 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.6 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.5 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.4 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.1 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.2 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.3 test/rails_root/test/unit/user_test.rb
muck-shares-0.1.0 test/rails_root/test/unit/user_test.rb