@@ -49,10 +49,10 @@ describe('SchemaManager', function() {
49
49
// ------------------------------------------------------------------------
50
50
// make sure option 'associations' functions as expected
51
51
// ------------------------------------------------------------------------
52
- describe ( `Ensure option 'associations' with default value 'true':` , function ( ) {
52
+ describe ( `Ensure option 'associations' with user-specificed value 'true':` , function ( ) {
53
53
const schemaManager = new SchemaManager
54
54
const strategy = new OpenApiStrategy
55
- const schema = schemaManager . generate ( models . User , strategy )
55
+ const schema = schemaManager . generate ( models . User , strategy , { associations : true } )
56
56
57
57
it ( `generates association property 'profile'` , function ( ) {
58
58
expect ( schema . properties ) . toHaveProperty ( 'profile' )
@@ -63,12 +63,10 @@ describe('SchemaManager', function() {
63
63
} )
64
64
} )
65
65
66
- describe ( `Ensure option 'associations' with user-specificed value 'false':` , function ( ) {
66
+ describe ( `Ensure option 'associations' with default value 'false':` , function ( ) {
67
67
const schemaManager = new SchemaManager
68
68
const strategy = new OpenApiStrategy
69
- const schema = schemaManager . generate ( models . User , strategy , {
70
- associations : false ,
71
- } )
69
+ const schema = schemaManager . generate ( models . User , strategy )
72
70
73
71
it ( `does not generate association property 'profile'` , function ( ) {
74
72
expect ( schema . properties ! [ 'profile' ] ) . toBeUndefined ( )
@@ -88,6 +86,7 @@ describe('SchemaManager', function() {
88
86
const strategy = new OpenApiStrategy
89
87
const schema = schemaManager . generate ( models . User , strategy , {
90
88
includeAssociations : [ 'profile' ] ,
89
+ associations : true
91
90
} ) ;
92
91
93
92
it ( `include association 'profile'` , function ( ) {
@@ -107,6 +106,7 @@ describe('SchemaManager', function() {
107
106
const strategy = new OpenApiStrategy
108
107
const schema = schemaManager . generate ( models . User , strategy , {
109
108
excludeAssociations : [ 'profile' ] ,
109
+ associations : true
110
110
} ) ;
111
111
112
112
it ( `do not include association 'profile'` , function ( ) {
0 commit comments