Skip to content

Commit

Permalink
update DocumentSpec to OpenAPI v3 test files
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Nov 8, 2022
1 parent 704f3a3 commit cbea3cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test-harness/docbox/**
test-harness/testbox/**
test-harness/logs/**
test-harness/modules/**
test-harness/tests/resources/petstore/test.yaml

# log files
logs/**
18 changes: 6 additions & 12 deletions test-harness/tests/specs/DocumentSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,13 @@ component extends="BaseOpenAPISpec"{
.toHaveKey( "getDocument" );

// test that path items have resource IDs
var instanceDoc = DocumentObject.getDocument();

for( var pathKey in instanceDoc[ "paths" ] ){

expect( instanceDoc[ "paths" ][ pathKey ] ).toHaveKey( "x-resourceId" );

if( structKeyExists( instanceDoc[ "paths" ][ pathKey ], "methods" ) ){
for( var methodKey in instanceDoc[ "paths" ][ pathKey ][ "methods" ] ){
expect( instanceDoc[ "paths" ][ pathKey ][ "methods" ][ methodKey ] ).toHaveKey( "x-resourceId" );
}
}
}
var instanceDoc = DocumentObject.getNormalizedDocument();

expect( instanceDoc ).toHaveKey( "openapi" )
.toHaveKey( "info" )
.toHaveKey( "paths" )
.toHaveKey( "servers" )
.toHaveKey( "tags" );
} );


Expand Down

0 comments on commit cbea3cc

Please sign in to comment.