class UserControllerTest < ActionController::TestCase
api_fixtures
- fixtures :messages
##
# test all routes which lead to this controller
end
def test_api_details
+ create(:message, :read, :recipient => users(:normal_user))
+
# check that nothing is returned when not logged in
get :api_details
assert_response :unauthorized
# Get users to work with
user = users(:normal_user)
friend = users(:public_user)
- create(:friend, :user_id => user.id, :friend_user_id => friend.id)
+ create(:friend, :befriender => user, :befriendee => friend)
# Check that the users are friends
assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first