diff --git a/spec/integration/v2/jobs_spec.rb b/spec/integration/v2/jobs_spec.rb index 6e092e00..b865ed59 100644 --- a/spec/integration/v2/jobs_spec.rb +++ b/spec/integration/v2/jobs_spec.rb @@ -86,6 +86,8 @@ describe 'Jobs' do describe "POST /jobs/:id/annotations" do context "with valid credentials" do it "responds with a 204" do + Travis::Services::UpdateAnnotation.any_instance.stubs(:annotations_enabled?).returns(true) + annotation_provider = Factory(:annotation_provider) response = post "/jobs/#{job.id}/annotations", { username: annotation_provider.api_username, key: annotation_provider.api_key, status: "passed", description: "Foobar" }, headers response.status.should eq(204) diff --git a/spec/unit/endpoint/jobs_spec.rb b/spec/unit/endpoint/jobs_spec.rb index 23dc5636..ca9e143c 100644 --- a/spec/unit/endpoint/jobs_spec.rb +++ b/spec/unit/endpoint/jobs_spec.rb @@ -9,6 +9,8 @@ describe Travis::Api::App::Endpoint::Jobs do end it "POST /jobs/:id/annotations" do + Travis::Services::UpdateAnnotation.any_instance.stubs(:annotations_enabled?).returns(true) + response = post("/jobs/#{job.id}/annotations", { "username" => provider.api_username, "key" => provider.api_key, "status" => "passed", "description" => "Foobar" }, "HTTP_ACCEPT" => "application/vnd.travis-ci.2+json, */*; q=0.01").should be_successful end end