Sha256: be0b887842be78c012fe5e6b7d9a34982a379a17623a9a9a3c3f55a985c72a9e

Contents?: true

Size: 844 Bytes

Versions: 3

Compression:

Stored size: 844 Bytes

Contents

require File.expand_path '../spec_helper.rb', __FILE__
require File.expand_path '../../lib/app.rb', __FILE__

describe 'puppetdb_rundeck Application' do
  it 'homepage should redirect to api page' do
    get '/'
    last_response.should be_redirect
    follow_redirect!
    last_request.url.should == 'http://example.org/api'
  end

  it 'should allow access to the main api page' do
    get '/api'
    last_response.should be_ok
    last_response.body.should include('Three API endpoints are provided')
  end

  it 'should allow access to the xml endpoint' do
    stub_request(:any, /puppetdb/).to_rack(FakePuppetDB)
    get '/api/xml'
    last_response.should be_ok
  end

  it 'should allow access to the yaml endpoint' do
    stub_request(:any, /puppetdb/).to_rack(FakePuppetDB)
    get '/api/yaml'
    last_response.should be_ok
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppetdb_rundeck-1.0.0 spec/app_spec.rb
puppetdb_rundeck-0.3.1 spec/app_spec.rb
puppetdb_rundeck-0.3.0 spec/app_spec.rb