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
Brandon Barrette20,485 Points
Bocking UI erros in user_friendship_controller_test
I'm getting errors only on the "accepted_user_friendship" portion of the tests. Here's the errors I am getting:
test: #index when logged in accepted friendships should display requested friends. (UserFriendshipsControllerTest):
NoMethodError: undefined method `accepted_user_friendships' for # <User:0x0000010527b8d8>
There seems to be an undefined method somewhere, but I can't figure out how to fix this. I've looked at the files from the download zip on this section and can't seem to find what's wrong. Any pointing in the right direction would be much appreciated.
Here's the part of the test that is failing:
context "accepted friendships" do
get :index, list: 'accepted'
should "get the index without error" do
should "not display pending or active friend's names" do
assert_no_match /Blocked/, response.body
assert_no_match /Requested/, response.body
should "display requested friends" do
assert_match /Active/, response.body
Answer is in the replies.
Way to go Jason and Brandon!