require 'test_helper'

class FollowTest < ActiveSupport::TestCase
  fixtures :follows
    
  def test_should_require_user_id
    follow = Follow.create(:user_id => nil)
    assert follow.errors.on(:user_id), "Missing User ID should add an error"
  end
  
  def test_should_require_user_follower_id
    follow = Follow.create(:user_follow_id => nil)
    assert follow.errors.on(:user_follow_id), "Missing User Follower ID should add an error"
  end
  
  def test_should_require_follow_level
    follow = Follow.create(:follow_level => nil)
    assert follow.errors.on(:follow_level), "Missing follow_level should add an error"
  end
  
  def test_should_not_have_same_user
    follow = Follow.create(:user_follow_id => 1, :user_id => 1)
    assert follow.errors.on(:user_follow_id == :user_id), "User Follower ID should not be User ID"
  end
end