Don't error out if xml is requested with something else than repo
This commit is contained in:
parent
c0b9a468d6
commit
705927ff74
|
@ -15,6 +15,10 @@ module Travis::Api::App::Responders
|
||||||
started: 'Building'
|
started: 'Building'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def apply?
|
||||||
|
super && resource.is_a?(Repository)
|
||||||
|
end
|
||||||
|
|
||||||
def apply
|
def apply
|
||||||
halt TEMPLATE % data
|
halt TEMPLATE % data
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,6 +86,11 @@ describe 'Repos' do
|
||||||
response.should deliver_cc_xml_for(Repository.by_slug('svenfuchs/minimal').first)
|
response.should deliver_cc_xml_for(Repository.by_slug('svenfuchs/minimal').first)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not respond with cc.xml for /repos list' do
|
||||||
|
response = get '/repos', {}, 'HTTP_ACCEPT' => 'application/xml; version=2'
|
||||||
|
response.status.should == 406
|
||||||
|
end
|
||||||
|
|
||||||
describe 'GET /repos/svenfuchs/minimal.png?branch=foo,bar' do
|
describe 'GET /repos/svenfuchs/minimal.png?branch=foo,bar' do
|
||||||
let(:on_foo) { Factory(:commit, branch: 'foo') }
|
let(:on_foo) { Factory(:commit, branch: 'foo') }
|
||||||
let(:on_bar) { Factory(:commit, branch: 'bar') }
|
let(:on_bar) { Factory(:commit, branch: 'bar') }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user