[rspec-devel] rspec_on_rails, speccing models, adding it helpers...
Zach Dennis
zach.dennis at gmail.com
Tue Apr 1 17:29:01 EDT 2008
I've got model helpers which perform reflection on associations to
ensure a relationship exists as expected. It doesn't test the
association (I think Rails does a pretty good job of ensuring the
association works). I'm looking for feedback on if folks (and the
rspec team =) would accept such a patch.
Example:
describe SomeModel do
it_has_many :widgets, :destroy => :null, :class_name => "BaseWidget"
it_has_one :fuzzbucket
it_belongs_to :another_model
end
it relies on the top level describe's description_type to determine
what model to reflect on. It removes a lot of boilerplate code for
spec'ing standard associations.
Thoughts?
--
Zach Dennis
http://www.continuousthinking.com
More information about the rspec-devel
mailing list