Commit 1ce76636 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Change dependencies.builds to depends_on_builds

parent ac652d82
...@@ -53,26 +53,24 @@ Returns: ...@@ -53,26 +53,24 @@ Returns:
"public": true "public": true
} }
], ],
"dependencies": { "depends_on_builds": [
"builds": [ {
{ "id": 48584,
"id": 48584, "ref": "0.1.1",
"ref": "0.1.1", "tag": true,
"tag": true, "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
"sha": "d63117656af6ff57d99e50cc270f854691f335ad", "status": "success",
"status": "success", "name": "build",
"name": "build", "token": "9dd60b4f1a439d1765357446c1084c",
"token": "9dd60b4f1a439d1765357446c1084c", "stage": "build",
"stage": "build", "project_id": 479,
"project_id": 479, "project_name": "test",
"project_name": "test", "artifacts_file": {
"artifacts_file": { "filename": "artifacts.zip",
"filename": "artifacts.zip", "size": 0
"size": 0
}
} }
] }
} ]
} }
``` ```
......
...@@ -20,7 +20,7 @@ module Ci ...@@ -20,7 +20,7 @@ module Ci
expose :name, :token, :stage expose :name, :token, :stage
expose :project_id expose :project_id
expose :project_name expose :project_name
expose :artifacts_file, using: ArtifactFile, if: lambda { |build, opts| build.artifacts_file.exists? } expose :artifacts_file, using: ArtifactFile, if: lambda { |build, opts| build.artifacts? }
end end
class BuildDetails < Build class BuildDetails < Build
...@@ -39,9 +39,7 @@ module Ci ...@@ -39,9 +39,7 @@ module Ci
end end
expose :variables expose :variables
expose :dependencies do expose :depends_on_builds, using: Build
expose :depends_on_builds, as: :builds, using: Build
end
end end
class Runner < Grape::Entity class Runner < Grape::Entity
......
...@@ -110,8 +110,8 @@ describe Ci::API::API do ...@@ -110,8 +110,8 @@ describe Ci::API::API do
post ci_api("/builds/register"), token: runner.token, info: { platform: :darwin } post ci_api("/builds/register"), token: runner.token, info: { platform: :darwin }
expect(response.status).to eq(201) expect(response.status).to eq(201)
expect(json_response["dependencies"]["builds"].count).to eq(2) expect(json_response["depends_on_builds"].count).to eq(2)
expect(json_response["dependencies"]["builds"][0]["name"]).to eq("rspec") expect(json_response["depends_on_builds"][0]["name"]).to eq("rspec")
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment