custom error message options

This commit is contained in:
Adam Meehan
2010-08-31 13:23:07 +10:00
parent 728439201d
commit 2f3efa2107
3 changed files with 36 additions and 1 deletions

View File

@@ -130,4 +130,13 @@ describe ValidatesTimeliness::Validator do
end
end
end
context "custom error message" do
it 'should be used for failing restriction' do
Person.validates_date :birth_date, :before => Time.now, :before_message => 'custom before message'
invalid!(:birth_date, Time.now, 'custom before message')
end
end
end