Skip to content

Commit

Permalink
Merge pull request #118 from apiaryio/honzajavorek/update-swagger-ada…
Browse files Browse the repository at this point in the history
…pter

Update Swagger adapter, pin Fury deps
  • Loading branch information
honzajavorek committed Nov 8, 2017
2 parents d254235 + 17ecff5 commit f0053c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"dependencies": {
"caseless": "^0.12.0",
"clone": "^2.1.1",
"fury": "^3.0.0-beta.4",
"fury-adapter-apib-parser": "^0.9.0",
"fury-adapter-swagger": "^0.14.2",
"fury": "3.0.0-beta.4",
"fury-adapter-apib-parser": "0.9.0",
"fury-adapter-swagger": "0.15.0",
"uri-template": "^1.0.0"
},
"devDependencies": {
Expand Down
10 changes: 7 additions & 3 deletions test/integration/compile-swagger-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('compile() · Swagger', ->
compilationResult = undefined
filename = 'apiDescription.json'
detectTransactionExampleNumbers = sinon.spy(require('../../src/detect-transaction-example-numbers'))
expectedStatusCodes = [200, 200, 400, 400, 500, 500]
expectedStatusCodes = [200, 400, 500]

beforeEach((done) ->
stubs = {'./detect-transaction-example-numbers': detectTransactionExampleNumbers}
Expand All @@ -123,6 +123,11 @@ describe('compile() · Swagger', ->
it('returns expected number of transactions', ->
assert.equal(compilationResult.transactions.length, expectedStatusCodes.length)
)
it('skips non-JSON media types in \'produces\'', ->
compilationResult.transactions.forEach((transaction) ->
assert.equal(transaction.response.headers['Content-Type'].value, 'application/json')
)
)
it('is compiled with no warnings', ->
assert.deepEqual(compilationResult.warnings, [])
)
Expand All @@ -142,10 +147,9 @@ describe('compile() · Swagger', ->
)

it('uses status code and response\'s Content-Type as example name', ->
contentType = if i % 2 then 'application/json' else 'application/xml'
assert.equal(
compilationResult.transactions[i].origin.exampleName,
"#{statusCode} > #{contentType}"
"#{statusCode} > application/json"
)
)
)
Expand Down

0 comments on commit f0053c8

Please sign in to comment.