Permalink
Browse files

Add spec to ensure presence of validations

Books create action checks attributes validity so we need a spec to
ensure these validations are done.
  • Loading branch information...
Bounga committed Jun 26, 2015
1 parent 8cf8d27 commit 5ad2e64d90acfb28cd621e67784fbd907900a6b1
Showing with 9 additions and 0 deletions.
  1. +9 −0 source/guides/getting-started.md
@@ -832,6 +832,15 @@ describe Web::Controllers::Books::Create do
response = action.call(params)
response[0].must_equal 200
end
it 'sets errors attribute accordingly' do
action.call(params)
refute action.params.valid?
action.errors.for('book.title').wont_be_empty
action.errors.for('book.author').wont_be_empty
end
end
end
```

0 comments on commit 5ad2e64

Please sign in to comment.