Add `validates_presence_of` example with `on` option

This commit is contained in:
Luciano Sousa 2013-10-11 12:20:32 -03:00 committed by Melissa Xie
parent 7c98335ca8
commit a6778f165b
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ describe Post do
it { should validate_uniqueness_of(:title).scoped_to(:user_id, :category_id) }
it { should validate_presence_of(:body).with_message(/wtf/) }
it { should validate_presence_of(:title) }
it { should validate_presence_of(:title).on(:update) }
it { should validate_numericality_of(:user_id) }
it { should ensure_inclusion_of(:status).in_array(['draft', 'public']) }
end