travis-api/spec/unit/default_spec.rb
2012-10-02 16:39:38 +02:00

16 lines
395 B
Ruby

require 'spec_helper'
describe Travis::Api::App::Endpoint::Home 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