It seems that the fixtures are not correct (not complete). When I 
specify the commentable_type and _id, it works:

  commentable_type: "Blog"
  commentable_id: 1

Why is that? I'd like to put the fixtures as loose as possible into the 
database and then hardwire them to the needed other objects in each 
test, so for the blog_test.rb I wanted to do:

  def setup
    @valid_blog = Blog.new(valid_blog_attributes)
    @valid_blog.comments << comments
  end

...and I hoped that this would automatically set the commentable_type 
and _id to the needed values then.

But this doesn't seem so. So I guess I have to hardwire the stuff all in 
the fixtures... Or are there other, better ways to achieve better 
dynamics?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to