[rspec-users] a better "should have valid associations"
chad at spicycode.com
Fri Mar 30 20:21:06 EDT 2007
sweet, missed your earlier post, looks like we've both finished these out :)
On 3/29/07, Josh Knowles <joshknowles at gmail.com> wrote:
> On 3/29/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > How about this?
> > project.should belong_to(:manager)
> > manager.should have_many(:projects)
> > etc
> > This would involve more matchers, but could be implemented in the same
> > fashion as have_association is above.
> I've implenented the first pass at the following rails matchers:
> should belong_to(association)
> should have_many(association)
> should validate_confirmation_of(attribute)
> should validate_format_of(attribute, valid => , invalid => )
> should validate_lendth_of(attribute, range)
> should validate_presence_of(attribute)
> should validate_uniqueness_of(attribute)
> Plugin available here:
> I haven't had a chance to get the README done, or any rdoc, but there are
> specs for the majority of the matchers.
> Comments / Suggestions Welcome!
> Josh Knowles
> joshknowles at gmail.com
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users