@@ -72,20 +72,20 @@ describe('Document Controller', () => {
72
72
describe ( 'create' , ( ) => {
73
73
it ( 'should throw an error if the "index" argument is not provided' , ( ) => {
74
74
should ( function ( ) {
75
- kuzzle . document . create ( undefined , 'collection' , 'document-id' , { foo : 'bar' } , options ) ;
75
+ kuzzle . document . create ( undefined , 'collection' , { foo : 'bar' } , 'document-id' , options ) ;
76
76
} ) . throw ( 'Kuzzle.document.create: index is required' ) ;
77
77
} ) ;
78
78
79
79
it ( 'should throw an error if the "collection" argument is not provided' , ( ) => {
80
80
should ( function ( ) {
81
- kuzzle . document . create ( 'index' , undefined , 'document-id' , { foo : 'bar' } , options ) ;
81
+ kuzzle . document . create ( 'index' , undefined , { foo : 'bar' } , 'document-id' , options ) ;
82
82
} ) . throw ( 'Kuzzle.document.create: collection is required' ) ;
83
83
} ) ;
84
84
85
- it ( 'should throw an error if the "body " argument is not provided' , ( ) => {
85
+ it ( 'should throw an error if the "document " argument is not provided' , ( ) => {
86
86
should ( function ( ) {
87
- kuzzle . document . create ( 'index' , 'collection' , 'document-id' , undefined , options ) ;
88
- } ) . throw ( 'Kuzzle.document.create: body is required' ) ;
87
+ kuzzle . document . create ( 'index' , 'collection' , undefined , 'document-id' , options ) ;
88
+ } ) . throw ( 'Kuzzle.document.create: document is required' ) ;
89
89
} ) ;
90
90
91
91
it ( 'should call document/create query and return a Promise which resolves the created document' , ( ) => {
@@ -96,7 +96,7 @@ describe('Document Controller', () => {
96
96
} ;
97
97
kuzzle . query . resolves ( { result} ) ;
98
98
99
- return kuzzle . document . create ( 'index' , 'collection' , 'document-id' , { foo : 'bar' } , options )
99
+ return kuzzle . document . create ( 'index' , 'collection' , { foo : 'bar' } , 'document-id' , options )
100
100
. then ( res => {
101
101
should ( kuzzle . query )
102
102
. be . calledOnce ( )
@@ -122,7 +122,7 @@ describe('Document Controller', () => {
122
122
} ;
123
123
kuzzle . query . resolves ( { result} ) ;
124
124
125
- return kuzzle . document . create ( 'index' , 'collection' , 'document-id' , { foo : 'bar' } , { refresh : true } )
125
+ return kuzzle . document . create ( 'index' , 'collection' , { foo : 'bar' } , 'document-id' , { refresh : true } )
126
126
. then ( res => {
127
127
should ( kuzzle . query )
128
128
. be . calledOnce ( )
0 commit comments