Skip to content

Commit cbea3cc

Browse files
committed
update DocumentSpec to OpenAPI v3 test files
1 parent 704f3a3 commit cbea3cc

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test-harness/docbox/**
1010
test-harness/testbox/**
1111
test-harness/logs/**
1212
test-harness/modules/**
13+
test-harness/tests/resources/petstore/test.yaml
1314

1415
# log files
1516
logs/**

test-harness/tests/specs/DocumentSpec.cfc

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,13 @@ component extends="BaseOpenAPISpec"{
3030
.toHaveKey( "getDocument" );
3131

3232
// test that path items have resource IDs
33-
var instanceDoc = DocumentObject.getDocument();
34-
35-
for( var pathKey in instanceDoc[ "paths" ] ){
36-
37-
expect( instanceDoc[ "paths" ][ pathKey ] ).toHaveKey( "x-resourceId" );
38-
39-
if( structKeyExists( instanceDoc[ "paths" ][ pathKey ], "methods" ) ){
40-
for( var methodKey in instanceDoc[ "paths" ][ pathKey ][ "methods" ] ){
41-
expect( instanceDoc[ "paths" ][ pathKey ][ "methods" ][ methodKey ] ).toHaveKey( "x-resourceId" );
42-
}
43-
}
44-
}
33+
var instanceDoc = DocumentObject.getNormalizedDocument();
4534

35+
expect( instanceDoc ).toHaveKey( "openapi" )
36+
.toHaveKey( "info" )
37+
.toHaveKey( "paths" )
38+
.toHaveKey( "servers" )
39+
.toHaveKey( "tags" );
4640
} );
4741

4842

0 commit comments

Comments
 (0)