From e45aa12d9736d48675b7965813750bb8b489c2b3 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" <cscott@cscott.net> Date: Wed, 12 Nov 2014 22:47:08 -0500 Subject: [PATCH] Add spec for /repos/*/branches/* endpoint --- spec/integration/v2/repositories_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/integration/v2/repositories_spec.rb b/spec/integration/v2/repositories_spec.rb index 6989f72a..86792000 100644 --- a/spec/integration/v2/repositories_spec.rb +++ b/spec/integration/v2/repositories_spec.rb @@ -144,6 +144,13 @@ describe 'Repos' do response.should deliver_json_for(repo.last_finished_builds_by_branches, version: 'v2', type: 'branches') end + it 'GET /repos/svenfuchs/minimal/branches/mybranch' do + mybuild = Factory(:build, repository: repo, state: :started, commit: Factory(:commit, branch: 'mybranch'), request: Factory(:request, event_type: 'push')) + response = get "/repos/svenfuchs/minimal/branches/mybranch", {}, headers + body = JSON.parse(response.body) + body['branch']['id'].should == mybuild.id + 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') }