How to test for relationships

Hi,

Is there a way to test the relationships of my models exist wwihtin my
new unit tests?

e.g. test this is here
class Blog < ActiveRecord::Base
belongs_to :user
end

and so is this?

class User< ActiveRecord::Base
has_many :blogs
end

thanks

On Jun 29, 2007, at 11:18 AM, Mark wrote:

and so is this?

class User< ActiveRecord::Base
has_many :blogs
end

thanks

User.reflect_on_association(:blogs).macro # returns :has_many

See more in the docs:
http://api.rubyonrails.org/classes/ActiveRecord/Reflection/
ClassMethods.html

-Rob

Rob B. http://agileconsultingllc.com
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs