Sha256: a07460487fb000fc82272094450aa3c5a55ca8077c13b5ad560eee397f279a98

Contents?: true

Size: 611 Bytes

Versions: 11

Compression:

Stored size: 611 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
    end

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

    expect(swagger_json).to eq(api_json)
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
swaggard-0.5.4 spec/integration/swaggard_spec.rb
swaggard-0.5.3 spec/integration/swaggard_spec.rb
swaggard-0.5.2 spec/integration/swaggard_spec.rb
swaggard-0.5.1 spec/integration/swaggard_spec.rb
swaggard-0.5.0 spec/integration/swaggard_spec.rb
swaggard-0.4.0 spec/integration/swaggard_spec.rb
swaggard-0.3.0 spec/integration/swaggard_spec.rb
swaggard-0.2.1 spec/integration/swaggard_spec.rb
swaggard-0.2.0 spec/integration/swaggard_spec.rb
swaggard-0.1.1 spec/integration/swaggard_spec.rb
swaggard-0.1.0 spec/integration/swaggard_spec.rb