Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Casey Clayton
16,708 PointsDeleting User Friendships
I am getting a no method error on mutual_friendship for nil::NilClass but the odd thing is I use this same method in the test more than once but it just errors out in the #delete_mutual_friendship context and I can't figure out why. The line that errors is this
assert_equal @friendship2, @friendship1.mutual_friendship
Yet in my #accept! context I use it like so and it works just fine.
assert_equal 'accepted', @user_friendship.mutual_friendship.state
Jason or anyone know the issue? The method is there and the delete_mutual_friendship method is there and not causing any errors but yet this one is.
Casey Clayton
16,708 PointsCasey Clayton
16,708 PointsAnyone have any suggestions, I still can't find what's going wrong here!