#57 √ committed
Ryan McGeary

Allow AR macros to validate against object state

Reported by Ryan McGeary | July 28th, 2008 @ 12:47 PM

I've started working on this, but I'm placing this here for tracking purposes.

For example, allow for something like this:

context "An admin user" do
   setup { @user = Factory(:user, :admin => true) }
   should_require_attributes :name
end 
  1. use "@#{model_class.to_s.underscore}" if that instance variable exists (e.g. @post or @line_item)
  2. else, use model_class.new

More information is available in this thread:

http://groups.google.com/group/s...

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket