1
0
Fork 0
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:
Paweł Gościcki 2012-10-15 13:45:08 +03:00
parent a228e0e0ef
commit 671c0ec5bb

View file

@ -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) }