mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Add scoped uniqueness example to README
I keep hitting Google for the exact syntax of this.
This commit is contained in:
parent
a228e0e0ef
commit
671c0ec5bb
1 changed files with 1 additions and 0 deletions
|
@ -27,6 +27,7 @@ Matchers to test validations and mass assignments:
|
|||
|
||||
describe Post do
|
||||
it { should validate_uniqueness_of(:title) }
|
||||
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_numericality_of(:user_id) }
|
||||
|
|
Loading…
Reference in a new issue