travis-api/spec/unit/default_spec.rb
2016-06-19 14:35:54 +02:00

14 lines
387 B
Ruby

describe Travis::Api::App::Endpoint::Home, set_app: true do
describe 'GET /' do
it 'replies with a json response by default' do
get('/')["Content-Type"].should include("json")
end
it 'redirects HTML requests to /docs' do
get '/', {}, 'HTTP_ACCEPT' => 'text/html'
status.should == 302
headers['Location'].should end_with('/docs/')
end
end
end