Hi all,

I'm trying to make the tasks, but I am with some doubts.

# Update the title of the first post
# Assert that the title has been changed

If I understood correctly the material, the test must be so:

post = posts(:one)
assert post.update_attributes(:title => 'Homework')

Is it correct?

# Add another comment to the first post
# Assert that the new comment has been added

This test is the more confused. First:

mypost = posts(:one)
post '/posts/post_comment', :comment => {:post_id=>
(:mypost).id, :comment => "homework comment"}

I think that hitherto alright, but I don't know how to make the
assert. I think that's so:

assert :comment, mypost.comments.first                    # or
assert assigns(:comment).valid?

This lesson is very difficult for me. Thank in Advance for any help =)
Juliano
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to