I think, problem is in following lines, you are trying to create friendship with friend: friend(:neha)
, you should use create friend with users(:neha)
:-
assert_nothing_raised do
UserFriendship.create user: users(:brijesh), friend: users(:neha)
end
Thanks