Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #49 from mulesoft-labs/22_default_mediatype
Browse files Browse the repository at this point in the history
fixes #22 test that default mediatype is working.
  • Loading branch information
jstoiko authored Apr 4, 2018
2 parents 5827442 + 002b22b commit 8b65548
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/fixtures/example10.raml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#%RAML 1.0
title: Example API
baseUri: http://example.com/api
mediaType: application/json

/test:
get:
Expand Down Expand Up @@ -85,4 +86,12 @@ baseUri: http://example.com/api
200:
headers:
foo:
default: test
default: test
/defaultmediatype:
get:
responses:
200:
body:
example:
stringProperty: foo
numberProperty: 23
14 changes: 14 additions & 0 deletions test/test10.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,19 @@ describe('osprey mock service v1.0', function () {
expect(res.headers.foo).to.be.oneOf(['bar', 'foo', 'random', 'another'])
})
})

it('should default to document\'s mediatype', function () {
return popsicle.default(
{
method: 'GET',
url: '/api/defaultmediatype'
}
)
.use(server(http))
.then(function (res) {
expect(JSON.parse(res.body))
.to.deep.equal({stringProperty: 'foo', numberProperty: 23})
})
})
})
})

0 comments on commit 8b65548

Please sign in to comment.