Sha256: ca92aa24ffb0a58618bb8f3400bca726eac2b596c019d606e94d2bce578bf620

Contents?: true

Size: 658 Bytes

Versions: 2

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

require 'json-schema'

describe Swaggard, '.get_doc' do
  let(:controller_path) { File.expand_path('../../fixtures/dummy/app/controllers/**/*.rb', __FILE__) }
  let(:api_json)        { File.read(File.expand_path('../../fixtures/api.json', __FILE__)) }

  let(:host) { 'localhost:3000' }

  it 'generates the expected swagger json' do
    Swaggard.configure do |config|
      config.controllers_path = controller_path
      config.routes = Dummy::Application.routes.routes
      config.ignore_untagged_controllers = false
    end

    swagger_json = JSON.dump(Swaggard.get_doc(host))

    expect(swagger_json).to eq(api_json)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
swaggard-1.5.1 spec/integration/swaggard_spec.rb
swaggard-1.5.0 spec/integration/swaggard_spec.rb