@@ -3,7 +3,7 @@ require('../network')(seneca);
33const _ = require ( 'lodash' ) ;
44const flat = require ( 'flat' ) ;
55
6- const service = 'cd-eventbrite ' ;
6+ const service = 'cd-organisations ' ;
77// ENTITIES
88const entities = { } ;
99entities . userOrg = require ( '../lib/organisations/entities/userOrg.js' ) . bind ( seneca ) ( ) ;
@@ -70,23 +70,23 @@ describe('cp-organisations-service-controller', () => {
7070 // // VALIDATION
7171 // No need to validate them all, we just want to verify the bootloader (/lib/index)
7272 it ( 'should validate entities acts with joi' , ( done ) => {
73- seneca . act ( { role : 'cd-organisations' , entity : 'event ' , cmd : 'get' , id : { } } , ( err , app ) => {
73+ seneca . act ( { role : 'cd-organisations' , entity : 'org ' , cmd : 'get' } , ( err , app ) => {
7474 expect ( err . code ) . to . be . equal ( 'act_invalid_msg' ) ;
7575 done ( ) ;
7676 } ) ;
7777 } ) ;
7878 //
7979 it ( 'should validate entities acts while promised with joi' , ( done ) => {
80- const app = seneca . export ( 'cd-organisations/acts' ) . event ;
81- app . get ( { id : { } } )
80+ const app = seneca . export ( 'cd-organisations/acts' ) . org ;
81+ app . get ( { org : undefined } )
8282 . catch ( ( err ) => {
8383 expect ( err . code ) . to . be . equal ( 'act_invalid_msg' ) ;
8484 done ( ) ;
8585 } ) ;
8686 } ) ;
8787 //
8888 it ( 'should validate controllers acts with joi' , ( done ) => {
89- seneca . act ( { role : 'cd-organisations' , ctrl : 'auth ' , cmd : 'authorize ' , dojoId : { } } , ( err , app ) => {
89+ seneca . act ( { role : 'cd-organisations' , ctrl : 'userOrg ' , cmd : 'create ' , userOrg : { } } , ( err , app ) => {
9090 expect ( err . code ) . to . be . equal ( 'act_invalid_msg' ) ;
9191 done ( ) ;
9292 } ) ;
0 commit comments