Vulcan/packages/nova-posts/TESTS.md
2016-02-17 14:27:27 +09:00

34 lines
No EOL
739 B
Markdown

### Client-Side Operations
#### Insert
- `Posts.insert()` should always fail (no `allow/deny` validators are set on `Posts` collection for `insert` operation).
#### Update on allowed property
`Posts.update(postId, {$set: {title: "Hello World"}})` should return 1 only if current user is admin, or current user owns the post.
#### Update on admin-only property
`Posts.update(postId, {$set: {status: 1}})` should return 1 only if current user is admin.
#### Update on disallowed property
`Posts.update(postId, {$set: {baseScore: 999}})` should always throw an error.
### Meteor Method Calls
#### submitPost
#### editPost
### Server-Side Calls
#### Posts.submit()
`Posts.submit(post)` should insert a post in the database.