v3: fix specs

This commit is contained in:
Konstantin Haase 2015-10-08 18:45:26 +02:00
parent 2d0bb58e35
commit 860edf37bf
10 changed files with 79 additions and 505 deletions

View File

@ -14,44 +14,26 @@ describe Travis::API::V3::Services::Repository::Find do
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "standard",
"name" => "master",
"default_branch" => true,
"exists_on_github" => true,
"repository" => {
"@type" => "repository",
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"slug" => "svenfuchs/minimal",
"default_branch" => {
"@href" => "/v3/repo/#{repo.id}/branch/master"}},
"name" => "minimal",
"slug" => "svenfuchs/minimal"},
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{repo.default_branch.last_build.id}",
"@href" => "/v3/build/#{build.id}",
"@representation"=> "minimal",
"id" => repo.default_branch.last_build.id,
"number" => "3",
"state" => "configured",
"id" => build.id,
"number" => build.number,
"state" => build.state,
"duration" => nil,
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=> "minimal",
"id" => jobs[0].id},
{"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id},
{"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id},
{"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" =>jobs[3].id}]},
"exists_on_github"=> true
}}
"finished_at" => nil }}}
end
end

View File

@ -48,17 +48,18 @@ describe Travis::API::V3::Services::Branches::Find do
"limit" => 1 }},
"branches" => [{
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/#{branch.name}",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "standard",
"name" => branch.name,
"name" => "master",
"default_branch" => true,
"exists_on_github" => true,
"repository" => {
"@type" => "repository",
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"slug" => "svenfuchs/minimal",
"default_branch" => {
"@href" =>"/v3/repo/#{repo.id}/branch/master"}},
"name" => "minimal",
"slug" => "svenfuchs/minimal"},
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{build.id}",
@ -70,28 +71,7 @@ describe Travis::API::V3::Services::Branches::Find do
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=> "minimal",
"id" => jobs[0].id },
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id },
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id },
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id }]},
"exists_on_github" => true }]}
"finished_at" => nil }}]}
}
end
@ -125,17 +105,18 @@ describe Travis::API::V3::Services::Branches::Find do
"limit" => 1 }},
"branches" => [{
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/#{branch.name}",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "standard",
"name" => branch.name,
"name" => "master",
"default_branch" => true,
"exists_on_github" => true,
"repository" => {
"@type" => "repository",
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"slug" => "svenfuchs/minimal",
"default_branch" => {
"@href" =>"/v3/repo/#{repo.id}/branch/master"}},
"name" => "minimal",
"slug" => "svenfuchs/minimal"},
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{build.id}",
@ -147,28 +128,7 @@ describe Travis::API::V3::Services::Branches::Find do
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=> "minimal",
"id" => jobs[0].id },
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id },
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id },
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id }]},
"exists_on_github" => true }]}
"finished_at" => nil }}]}
}
end

View File

@ -2,8 +2,6 @@ require 'spec_helper'
describe Travis::API::V3::Services::Broadcasts::ForCurrentUser do
let(:repo) { Travis::API::V3::Models::Repository.where(owner_name: 'svenfuchs', name: 'minimal').first }
# let(:user) { Travis::API::V3::Models::User.where(login: 'svenfuchs') }
let(:token) { Travis::Api::App::AccessToken.create(user: repo.owner, app_id: 1) }
let(:headers) {{ 'HTTP_AUTHORIZATION' => "token #{token}" }}
@ -23,61 +21,37 @@ describe Travis::API::V3::Services::Broadcasts::ForCurrentUser do
let(:broadcasts){ Travis::API::V3::Models::Broadcast.where(recipient_id: [repo.id, org.id, repo.owner_id, nil]) }
describe "authenticated as user with access" do
describe "only active broadcasts" do
before { get("/v3/broadcasts", {}, headers) }
example { expect(last_response).to be_ok }
example { expect(JSON.load(body)).to be == {
"@type" => "broadcasts",
"@href" => "/v3/broadcasts",
"@representation" => "standard",
"broadcasts" => [{
"broadcasts" => []
}}
end
describe "only inactive broadcasts" do
let(:broadcast) { broadcasts.first }
before { get("/v3/broadcasts?broadcast.active=false", {}, headers) }
example { expect(last_response).to be_ok }
example { expect(JSON.load(body)["broadcasts"].first).to be == {
"@type" => "broadcast",
"@representation"=>"standard",
"id" => broadcasts[0].id,
"recipient_id" => broadcasts[0].recipient_id,
"recipient_type" => broadcasts[0].recipient_type,
"category" => broadcasts[0].category,
"kind" => nil,
"message" => broadcasts[0].message,
"expired" => false,
"@representation" => "standard",
"id" => broadcast.id,
"message" => broadcast.message,
"created_at" => "2010-11-12T13:00:00Z",
"updated_at" => "2010-11-12T13:00:00Z" },
{
"@type" => "broadcast",
"@representation"=> "standard",
"id" => broadcasts[1].id,
"recipient_id" => broadcasts[1].recipient_id,
"recipient_type" => broadcasts[1].recipient_type,
"category" => broadcasts[1].category,
"kind" => nil,
"message" => broadcasts[1].message,
"expired" => false,
"created_at" => "2010-11-12T13:00:00Z",
"updated_at" => "2010-11-12T13:00:00Z"},
{
"@type" => "broadcast",
"@representation"=> "standard",
"id" => broadcasts[2].id,
"recipient_id" => broadcasts[2].recipient_id,
"recipient_type" => broadcasts[2].recipient_type,
"category" => broadcasts[2].category,
"kind" => nil,
"message" => broadcasts[2].message,
"expired" => false,
"created_at" => "2010-11-12T13:00:00Z",
"updated_at" => "2010-11-12T13:00:00Z"},
{
"@type" => "broadcast",
"@representation"=> "standard",
"id" => broadcasts[3].id,
"recipient_id" => broadcasts[3].recipient_id,
"recipient_type" => broadcasts[3].recipient_type,
"category" => broadcasts[3].category,
"kind" => nil,
"message" => broadcasts[3].message,
"expired" => false,
"created_at" => "2010-11-12T13:00:00Z",
"updated_at" => "2010-11-12T13:00:00Z"}]
"category" => nil,
"active" => false,
"recipient" => {
"@type" => "repository",
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"name" => repo.name,
"slug" => repo.slug,
}
}}
end
end

View File

@ -67,21 +67,13 @@ describe Travis::API::V3::Services::Build::Find do
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"slug" => "svenfuchs/minimal",
"default_branch" => {
"@type" => "branch",
"@href" =>"/v3/repo/#{repo.id}/branch/master",
"@representation"=>"minimal",
"name" =>"master",
"last_build" => {
"@href" => "/v3/build/#{build.id}"}}},
"name" => repo.name,
"slug" => "svenfuchs/minimal"},
"branch" => {
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation"=> "minimal",
"name" => "master",
"last_build" => {
"@href" => "/v3/build/#{build.id}" }},
"name" => "master"},
"commit" => {
"@type" => "commit",
"@representation"=> "minimal",
@ -140,21 +132,13 @@ describe Travis::API::V3::Services::Build::Find do
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"slug" => "svenfuchs/minimal",
"default_branch" => {
"@type" => "branch",
"@href" =>"/v3/repo/#{repo.id}/branch/master",
"@representation"=>"minimal",
"name" =>"master",
"last_build" => {
"@href" => "/v3/build/#{build.id}"}}},
"name" => "minimal",
"slug" => "svenfuchs/minimal"},
"branch" => {
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation"=> "minimal",
"name" => "master",
"last_build" => {
"@href" => "/v3/build/#{build.id}" }},
"name" => "master"},
"commit" => {
"@type" => "commit",
"@representation"=> "minimal",

View File

@ -90,21 +90,13 @@ describe Travis::API::V3::Services::Builds::Find do
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"slug" => "svenfuchs/minimal",
"default_branch" => {
"@type" => "branch",
"@href" =>"/v3/repo/#{repo.id}/branch/master",
"@representation"=>"minimal",
"name" =>"master",
"last_build" => {
"@href" => "/v3/build/#{build.id}"}}},
"name" => "minimal",
"slug" => "svenfuchs/minimal"},
"branch" => {
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation"=> "minimal",
"name" => "master",
"last_build" => {
"@href" => "/v3/build/#{build.id}" }},
"name" => "master"},
"commit" => {
"@type" => "commit",
"@representation"=> "minimal",
@ -191,21 +183,13 @@ describe Travis::API::V3::Services::Builds::Find do
"@href" => "/v3/repo/#{repo.id}",
"@representation"=> "minimal",
"id" => repo.id,
"slug" => "svenfuchs/minimal",
"default_branch" => {
"@type" => "branch",
"@href" =>"/v3/repo/#{repo.id}/branch/master",
"@representation"=>"minimal",
"name" =>"master",
"last_build" => {
"@href" => "/v3/build/#{build.id}"}}},
"name" => "minimal",
"slug" => "svenfuchs/minimal"},
"branch" => {
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation"=> "minimal",
"name" => "master",
"last_build" => {
"@href" => "/v3/build/#{build.id}" }},
"name" => "master"},
"commit" => {
"@type" => "commit",
"@representation"=> "minimal",

View File

@ -40,69 +40,15 @@ describe Travis::API::V3::Services::Job::Find do
"event_type" => build.event_type,
"previous_state" => build.previous_state,
"started_at" => "2010-11-12T12:00:00Z",
"finished_at" => "2010-11-12T12:00:10Z",
"jobs" =>[
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=> "minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=> "minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=> "minimal",
"id" => jobs[2].id},
{
"@href" => "/v3/job/#{jobs[3].id}"}]},
"finished_at" => "2010-11-12T12:00:10Z"},
"queue" => job.queue,
"repository" => {
"@type" => "repository",
"@href" => "/v3/repo/#{repo.id}",
"@representation" => "minimal",
"id" => repo.id,
"slug" => repo.slug,
"default_branch" => {
"@type" => "branch",
"@href" =>"/v3/repo/#{repo.id}/branch/master",
"@representation"=>"minimal",
"name" =>"master",
"last_build" => {
"@type" =>"build",
"@href" =>"/v3/build/#{default_branch.last_build.id}",
"@representation"=>"minimal",
"id" => default_branch.last_build.id,
"number" => default_branch.last_build.number,
"state" => default_branch.last_build.state,
"duration" => nil,
"event_type" => "push",
"previous_state"=>"passed",
"started_at" =>"2010-11-12T13:00:00Z",
"finished_at"=> nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[0].id}",
"@representation" => "minimal",
"id" => def_branch_jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[1].id}",
"@representation"=>"minimal",
"id" => def_branch_jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[2].id}",
"@representation"=>"minimal",
"id" => def_branch_jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[3].id}",
"@representation"=>"minimal",
"id" => def_branch_jobs[3].id}]}}},
"name" => repo.name,
"slug" => repo.slug},
"commit" => {
"@type" => "commit",
"@representation" => "minimal",
@ -164,69 +110,15 @@ describe Travis::API::V3::Services::Job::Find do
"event_type" => build.event_type,
"previous_state" => build.previous_state,
"started_at" => "2010-11-12T12:00:00Z",
"finished_at" => "2010-11-12T12:00:10Z",
"jobs" =>[
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=> "minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=> "minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=> "minimal",
"id" => jobs[2].id},
{
"@href" => "/v3/job/#{jobs[3].id}"}]},
"finished_at" => "2010-11-12T12:00:10Z"},
"queue" => job.queue,
"repository" => {
"@type" => "repository",
"@href" => "/v3/repo/#{repo.id}",
"@representation" => "minimal",
"id" => repo.id,
"slug" => repo.slug,
"default_branch" => {
"@type" => "branch",
"@href" =>"/v3/repo/#{repo.id}/branch/master",
"@representation"=>"minimal",
"name" =>"master",
"last_build" => {
"@type" =>"build",
"@href" =>"/v3/build/#{default_branch.last_build.id}",
"@representation"=>"minimal",
"id" => default_branch.last_build.id,
"number" => default_branch.last_build.number,
"state" => default_branch.last_build.state,
"duration" => nil,
"event_type" => "push",
"previous_state"=>"passed",
"started_at" =>"2010-11-12T13:00:00Z",
"finished_at"=> nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[0].id}",
"@representation" => "minimal",
"id" => def_branch_jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[1].id}",
"@representation"=>"minimal",
"id" => def_branch_jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[2].id}",
"@representation"=>"minimal",
"id" => def_branch_jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{def_branch_jobs[3].id}",
"@representation"=>"minimal",
"id" => def_branch_jobs[3].id}]}}},
"name" => repo.name,
"slug" => repo.slug},
"commit" => {
"@type" => "commit",
"@representation" => "minimal",

View File

@ -62,8 +62,7 @@ describe Travis::API::V3::Services::Owner::Find do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "minimal",
"name" => "master",
"last_build" => nil }
"name" => "master"}
}]
}}
end
@ -108,8 +107,7 @@ describe Travis::API::V3::Services::Owner::Find do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation"=> "minimal",
"name" => "master",
"last_build" => nil }
"name" => "master"}
}]
}}
end

View File

@ -52,42 +52,7 @@ describe Travis::API::V3::Services::Owner::Repositories do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "minimal",
"name" => "master",
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{repo.default_branch.last_build.id}",
"@representation"=> "minimal",
"id" => repo.default_branch.last_build.id,
"number" => "3",
"state" => "configured",
"duration" => nil,
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=>"minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id}]
}}}]
}}
"name" => "master"}}]}}
end
describe "filter: private=false" do

View File

@ -52,40 +52,7 @@ describe Travis::API::V3::Services::Repositories::ForCurrentUser do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "minimal",
"name" => "master",
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{repo.default_branch.last_build.id}",
"@representation"=> "minimal",
"id" => repo.default_branch.last_build.id,
"number" => "3",
"state" => "configured",
"duration" => nil,
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=>"minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id}]
}}}]
"name" => "master"}}]
}}
end

View File

@ -60,40 +60,7 @@ describe Travis::API::V3::Services::Repository::Find do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "minimal",
"name" => "master",
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{repo.default_branch.last_build.id}",
"@representation"=> "minimal",
"id" => repo.default_branch.last_build.id,
"number" => "3",
"state" => "configured",
"duration" => nil,
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=>"minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id}]
}}
"name" => "master"}
}}
end
@ -176,40 +143,7 @@ describe Travis::API::V3::Services::Repository::Find do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "minimal",
"name" => "master",
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{repo.default_branch.last_build.id}",
"@representation"=> "minimal",
"id" => repo.default_branch.last_build.id,
"number" => "3",
"state" => "configured",
"duration" => nil,
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=>"minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id}]
}}
"name" => "master"}
}}
end
@ -277,40 +211,7 @@ describe Travis::API::V3::Services::Repository::Find do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "minimal",
"name" => "master",
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{repo.default_branch.last_build.id}",
"@representation"=> "minimal",
"id" => repo.default_branch.last_build.id,
"number" => "3",
"state" => "configured",
"duration" => nil,
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=>"minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id}]
}}
"name" => "master"}
}}
end
@ -384,40 +285,7 @@ describe Travis::API::V3::Services::Repository::Find do
"@type" => "branch",
"@href" => "/v3/repo/#{repo.id}/branch/master",
"@representation" => "minimal",
"name" => "master",
"last_build" => {
"@type" => "build",
"@href" => "/v3/build/#{repo.default_branch.last_build.id}",
"@representation"=> "minimal",
"id" => repo.default_branch.last_build.id,
"number" => "3",
"state" => "configured",
"duration" => nil,
"event_type" => "push",
"previous_state" => "passed",
"started_at" => "2010-11-12T13:00:00Z",
"finished_at" => nil,
"jobs" => [{
"@type" => "job",
"@href" => "/v3/job/#{jobs[0].id}",
"@representation"=>"minimal",
"id" => jobs[0].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[1].id}",
"@representation"=>"minimal",
"id" => jobs[1].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[2].id}",
"@representation"=>"minimal",
"id" => jobs[2].id},
{
"@type" => "job",
"@href" => "/v3/job/#{jobs[3].id}",
"@representation"=>"minimal",
"id" => jobs[3].id}]
}}
"name" => "master"}
}}
end