Saturday, September 10, 2011

[Rails] searching the an array of objects

Hi,

I'm trying to write some tests.

I have a complicated query for "matches"

one criteria is that one's matches should not contain someone from
your blocked list.

in testing the matches method, i'm not sure how to test this.

u = User.find(1)
u.blockUser(2)
u.matches.where(:user_id=>2).should be_empty

however where is an invalid method for an array, i see... And I can't
seem to do anything with the find method. Any ideas here?

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate