diff --git a/lib/travis/api/app/responders/xml.rb b/lib/travis/api/app/responders/xml.rb index 7a959a23..9fa43fcf 100644 --- a/lib/travis/api/app/responders/xml.rb +++ b/lib/travis/api/app/responders/xml.rb @@ -15,6 +15,10 @@ module Travis::Api::App::Responders started: 'Building' } + def apply? + super && resource.is_a?(Repository) + end + def apply halt TEMPLATE % data end diff --git a/spec/integration/v2/repositories_spec.rb b/spec/integration/v2/repositories_spec.rb index 0db122ae..0c2c928a 100644 --- a/spec/integration/v2/repositories_spec.rb +++ b/spec/integration/v2/repositories_spec.rb @@ -86,6 +86,11 @@ describe 'Repos' do response.should deliver_cc_xml_for(Repository.by_slug('svenfuchs/minimal').first) 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 let(:on_foo) { Factory(:commit, branch: 'foo') } let(:on_bar) { Factory(:commit, branch: 'bar') }