Add `validates_presence_of` example with `on` option
This commit is contained in:
parent
7c98335ca8
commit
a6778f165b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue