travis-web/spec/app_spec.rb
Konstantin Haase 6ea3f70723 fix test
2012-11-08 13:55:50 +01:00

34 lines
1.2 KiB
Ruby

require 'spec_helper'
describe Travis::Web::App do
before do
current_session.global_env['HTTP_ACCEPT'] = 'text/html,*/*'
end
describe 'catch all' do
before { get('/foo/bar') }
example { last_response.should be_ok }
example { headers['Content-Location'].should be == '/' }
example { headers['Cache-Control'].should include('must-revalidate') }
example { headers['Cache-Control'].should include('public') }
example { headers['Vary'].should include('Accept') }
end
describe 'assets' do
before { get('/favicon.ico') }
example { last_response.should be_ok }
example { headers['Content-Location'].should be == '/favicon.ico' }
example { headers['Cache-Control'].should_not include('must-revalidate') }
example { headers['Cache-Control'].should include('public') }
example { headers['Vary'].split(',').should_not include('Accept') }
end
describe 'version' do
before { get('/version') }
example { last_response.should be_ok }
example { headers['Content-Location'].should be == '/version' }
example { headers['Cache-Control'].should be == 'no-cache' }
example { headers['Vary'].split(',').should_not include('Accept') }
end
end