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
- use "@#{model_class.to_s.underscore}" if that instance variable exists (e.g. @post or @line_item)
- else, use model_class.new
More information is available in this thread:
Comments and changes to this ticket
-
Ryan McGeary July 30th, 2008 @ 09:18 AM
- → Assigned user changed from Tammer Saleh to Ryan McGeary
-
Ryan McGeary July 31st, 2008 @ 12:44 AM
- → State changed from new to committed
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 »
