On Sep 26, 1:38 pm, Leonardo Otero <[email protected]> wrote:
> I´m stucked with the same Lab point: Update the title of the first post.
>
> My problem is I don't know how to properly do a PUT call from an integration
> Test:
>
> class CreateNewPostAndCommentTest < ActionController::IntegrationTest
> ...
Actually something along this line should work:
post = posts(:one)
put "/posts/update/#{post.id}", :post => {:title => "Rails
changed"}
assert assigns(:post).valid?
assert_redirected_to post_path(assigns(:post))
then you should reassign post to get the post with new title.
post=assigns(:post)
and this is similar for adding comments.
> I'll be glad if you can give me any tip or link with a good explanation
> about RESTful PUT calls.
That's no tip nor good explanation, just the way I did it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
ruby-on-rails-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---