This commit is contained in:
Tony Tam
2015-01-29 12:15:32 -08:00
parent 89db848a80
commit b69320d79f
3 changed files with 2 additions and 51 deletions

2
dist/swagger-ui.js vendored
View File

@@ -1,5 +1,5 @@
// swagger-ui.js
// version 2.1.0-alpha.7
// version 2.1.0-alpha.8
$(function() {
// Helper function for vertically aligning DOM elements

View File

@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "2.1.0-alpha.7",
"version": "2.1.0-alpha.8",
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
"scripts": {
"build": "PATH=$PATH:./node_modules/.bin cake dist",

View File

@@ -1,49 +0,0 @@
window.url = "http://api.wordnik.com/v4/resources.json"
describe 'SwaggerUi', ->
describe 'constructor', ->
beforeEach ->
window.ui = new SwaggerUi
api_key: window.api_key
url: window.url
waitsFor ->
ui.ready
it "sets a `ready` property when the API is ready", ->
runs ->
expect(ui.ready).toBe(true)
it "has access to the precompiled Handlebars template", ->
runs ->
expect(Handlebars.templates['template.html']).toBeDefined()
describe 'DOM container', ->
afterEach ->
$("#swagger_ui").remove()
it "renders to default DOM container if it exists", ->
window.ui = new SwaggerUi
waitsFor ->
ui.ready
runs ->
expect($("#swagger_ui").length).toBe(1)
it "creates default DOM container if it doesn't exist", ->
expect($("#swagger_ui").length).toBe(0)
window.ui = new SwaggerUi
waitsFor ->
ui.ready
runs ->
expect($("#swagger_ui").length).toBe(1)
it "allows an alternate DOM container to be specified when initialized", ->
expect($("#swagger_ui").length).toBe(0)
window.ui = new SwaggerUi
dom_id: 'zhwagger'
waitsFor ->
ui.ready
runs ->
expect($("#zhwagger").length).toBe(1)