I use Shoulda in conjunction with Test :: Unit in one of the projects I'm working on. The problem I am facing is that I recently changed this:
class MyModel < ActiveRecord::Base
validates_presence_of :attribute_one, :attribute_two
end
:
class MyModel < ActiveRecord::Base
validates_presence_of :attribute_one
validates_presence_of :attribute_two, :on => :update
end
Previously, my (passing) tests looked like this:
class MyModelTest < ActiveSupport::TestCase
should_validate_presence_of :attribute_one, :attribute_two
end
As far as I can tell, should_validate_presence_ofthere is no parameter that will make this test continue to pass with the changes mentioned above. With the exception of the rejection of Shoulda when testing the requirement :attribute_two, is there any way to do this?
source
share