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

Ruby Building Social Features in Ruby on Rails Creating Friendships What is a Join Table?

Iyad Horani
PLUS
Iyad Horani
Courses Plus Student 6,141 Points

testing for current user when updating is failing with Rails4

Hi Guys

in Rails 4, the update action is different than Jason's. In Rails4 the update is using the set_status helper method to automatically assign the @status = Status.find(params[:id])

When adding the following to the update method

  def update
    @status = current_user.statuses.find(params[:id])
    ...

The testing fails. Any idea how to solve is?

1 Answer

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

This is in the statuses controller, right?

I had to hack through some thing about update, with paperclip, which added another layer. Here's my controller if that helps:

https://github.com/summerspirit/laughing-wookie/blob/master/app/controllers/statuses_controller.rb

I'm pretty good at explaining what is up with Rails 4, but this one is just a little beyond my reach. It's functional though.

My app isn't posted on heroku because the thing that is failing is actually my mailers, from Devise. It trips up your user_friendship button if you try to go live.