rails 3 + shoulda + validations based on callbacks -


i new shoulda. many of models have validations 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 , is_size_and_gdnt instance methods model

my shoulda validation first as

it { should validate_presence_of(:sampling_method) } 

but dont know how add check if

i have checked second validation using creating object using factory girl, , checking values when object saved how test second validation using shoulda


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -