travis-web/spec/mobile_redirect_spec.rb
Piotr Sarnacki 7ad4ed1109 Redirect to old version of travis for mobile clients
We're planning support for a new mobile client, but for the time being
we will just redirect to the old app.
2012-11-12 19:37:57 +01:00

21 lines
640 B
Ruby

require 'spec_helper'
describe Travis::Web::App::MobileRedirect do
describe 'with mobile client' do
let(:agent) { 'blah blah Mobile blablah' }
it 'redirects to secure.travis-ci.org' do
get('/foo/bar?baz', {}, 'HTTP_AGENT' => agent).should be_redirect
last_response.headers['Location'].should == 'https://secure.travis-ci.org/foo/bar?baz'
end
end
describe 'with mobile param' do
it 'redirects to secure.travis-ci.org' do
get('/foo/bar?baz', mobile: true).should be_redirect
last_response.headers['Location'].should == 'https://secure.travis-ci.org/foo/bar?mobile=true&baz'
end
end
end