assert_equal uses the == method to compare the two objects, and  == on
activerecord doesn't compare attributes: it only compares the id of
the object (ie do the compared objects represent the same row in the
database)

Fred

--
That is why I had this issue. I had two fixtures users.yml and gusers.yml.
Both had 'bob' defined with same record ID. Now users.yml was referred by
user controller and gusers.yml was referred by gusers controller. However
when I did assert_equal using gusers it pulled the record from the users
model instead of gusers model. I could not understand that behavior. 
When I changed the gusers.yml 'bob' to 'bob1' it pulled the record from the
correct gusers model.

This tell me that we have make sure IDs are unique across fixtures from
different models. That is confusing each model has to have its own space.

-- 
View this message in context: 
http://old.nabble.com/assert_equal-Test---how-to-test-updates-tp27424657p27430836.html
Sent from the RubyOnRails Users mailing list archive at Nabble.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