i am new to shoulda. many of my models have validations as below
validates :sampling_method, :presence => true, :if => :type_of_resource
validate :check_for_decimal_places, :if => :is_size_and_gdnt, :on => :update
here, type_of_resource and is_size_and_gdnt are instance methods for model
my shoulda validation for first is as
it { should validate_presence_of(:sampling_method) }
but i dont know how to add check for if
i have checked the second validation using by creating a object using factory girl, and checking its values when the object is saved but how do i test the second validation using shoulda