Sha256: 5b517f9b2761ad3f99c3d5240d78aeb0ea1929b6154bea6ff3c1efcfa03480c2

Contents?: true

Size: 767 Bytes

Versions: 2

Compression:

Stored size: 767 Bytes

Contents

require 'test_helper'

class TestSwaggerDocHandler < Minitest::Test

  include Rack::Test::Methods

  def app
    Rack::Lint.new(mounted_app)
  end

  def test_loading_api_docs_root
    get '/doc/api-docs'
    assert last_response.ok?
    response_json = JSON.parse(last_response.body)
    assert_equal response_json['apis'].size, 1
    assert_equal response_json['apis'].first['path'], '/../account'
  end

  def test_loading_individual_api_doc
    get '/doc/account'
    assert last_response.ok?
    response_json = JSON.parse(last_response.body)
    assert_equal response_json['apis'].size, 1
    assert response_json['models'].size > 1
    assert_equal response_json['models'].keys.first, 'PostAccount-Request'
    refute response_json['basePath'].nil?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
swagui-0.2.1 test/test_swagger_doc_handler.rb
swagui-0.2.0 test/test_swagger_doc_handler.rb