diff --git a/lib/travis/api/app/responders/base.rb b/lib/travis/api/app/responders/base.rb index 9c099cdd..8849f553 100644 --- a/lib/travis/api/app/responders/base.rb +++ b/lib/travis/api/app/responders/base.rb @@ -33,7 +33,7 @@ module Travis::Api::App::Responders end def apply? - acceptable_format? + resource && acceptable_format? end def format diff --git a/spec/integration/v1/repositories_spec.rb b/spec/integration/v1/repositories_spec.rb index aea3fd4c..b1b35fd1 100644 --- a/spec/integration/v1/repositories_spec.rb +++ b/spec/integration/v1/repositories_spec.rb @@ -40,10 +40,6 @@ describe 'v1 repos' do end describe 'GET /svenfuchs/minimal.png' do - it '"unknown" when the repository does not exist' do - get('/svenfuchs/does-not-exist.png').should deliver_result_image_for('unknown') - end - it '"unknown" when it only has one build that is not finished' do Build.delete_all Factory(:build, repository: repo, state: :created, result: nil) @@ -72,10 +68,6 @@ describe 'v1 repos' do let(:on_foo) { Factory(:commit, branch: 'foo') } let(:on_bar) { Factory(:commit, branch: 'bar') } - it '"unknown" when the repository does not exist' do - get('/svenfuchs/does-not-exist.png?branch=foo,bar').should deliver_result_image_for('unknown') - end - it '"unknown" when it only has unfinished builds on the relevant branches' do Build.delete_all Factory(:build, repository: repo, state: :started, commit: on_foo)