travis-api/spec/unit/endpoint/jobs_spec.rb
Hiro Asari b43568a0f9 Fix Annoation-related specs
Annotations are now blocked by features, so stub the service to
return true for the cases we expect to get data back from POST
requests
2014-01-29 14:30:23 -05:00

17 lines
714 B
Ruby

require 'spec_helper'
describe Travis::Api::App::Endpoint::Jobs do
let(:job) { Factory(:test) }
let(:provider) { Factory(:annotation_provider) }
it "GET /jobs/:id/annotations" do
get("/jobs/#{job.id}/annotations", {}, "HTTP_ACCEPT" => "application/vnd.travis-ci.2+json, */*; q=0.01").should be_ok
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