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
This commit is contained in:
Hiro Asari 2014-01-29 14:30:23 -05:00
parent aa2281ebfe
commit b43568a0f9
2 changed files with 4 additions and 0 deletions

View File

@ -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)

View File

@ -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