We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 345031a commit 1d19508Copy full SHA for 1d19508
tests/model.test.js
@@ -1,3 +1,4 @@
1
+import qs from 'qs'
2
import Post from './dummy/models/Post'
3
4
describe('Model methods', () => {
@@ -11,4 +12,18 @@ describe('Model methods', () => {
11
12
13
expect(errorModel).toThrow('The "id" must be a integer on find() method.')
14
})
15
+
16
+ test('it builds a complexy query', () => {
17
+ const post = Post
18
+ .where('title', 'Cool')
19
+ .where('status', 'ACTIVE')
20
+ .include('user')
21
+ .append('likes')
22
+ .orderBy('created_at')
23
24
+ const query = encodeURI('?include=user&filter[title]=Cool&filter[status]=ACTIVE&append=likes&sort=created_at')
25
26
+ expect(post._builder.query()).toEqual(query)
27
28
+ })
29
0 commit comments