I think this is what's happening.
The should_not
test is using an implicit subject of User.new
. In order to test update
on this subject, it must first be saved, but saving will result in an error because of the validation on create
. The workaround is create/save a valid user object and to call should_not validate_presence_of(...).on(:update)
explicitly on that object.
See the related Shoulda: Test validates_presence_of :on => :update