diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-06-05 21:57:29 +0200 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2018-06-05 21:57:29 +0200 |
commit | 46317b7dabd585bed42cf9c0008a7c69c080d33f (patch) | |
tree | 81e1468fdc061b45232b67537bb8181975015157 | |
parent | 3871ea33ca524ef2d420a4ff311d8535622bd150 (diff) | |
download | gitlab-ce-46317b7dabd585bed42cf9c0008a7c69c080d33f.tar.gz |
Removes variables from pipelines api
-rw-r--r-- | doc/api/pipelines.md | 3 | ||||
-rw-r--r-- | lib/api/entities.rb | 1 | ||||
-rw-r--r-- | spec/requests/api/pipelines_spec.rb | 15 |
3 files changed, 14 insertions, 5 deletions
diff --git a/doc/api/pipelines.md b/doc/api/pipelines.md index ae6c6ea7b49..ebae68fe389 100644 --- a/doc/api/pipelines.md +++ b/doc/api/pipelines.md @@ -133,8 +133,7 @@ Example of response "finished_at": null, "committed_at": null, "duration": null, - "coverage": null, - "variables": [] + "coverage": null } ``` diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 8773e2c029a..c4537036a3a 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1067,7 +1067,6 @@ module API expose :created_at, :updated_at, :started_at, :finished_at, :committed_at expose :duration expose :coverage - expose :variables, using: Entities::Variable end class PipelineSchedule < Grape::Entity diff --git a/spec/requests/api/pipelines_spec.rb b/spec/requests/api/pipelines_spec.rb index 0a64c46bb92..78ea77cb3bb 100644 --- a/spec/requests/api/pipelines_spec.rb +++ b/spec/requests/api/pipelines_spec.rb @@ -285,6 +285,15 @@ describe API::Pipelines do end describe 'POST /projects/:id/pipeline ' do + def expect_variables(variables, expected_variables) + variables.each_with_index do |variable, index| + expected_variable = expected_variables[index] + + expect(variable.key).to eq(expected_variable['key']) + expect(variable.value).to eq(expected_variable['value']) + end + end + context 'authorized user' do context 'with gitlab-ci.yml' do before do @@ -308,11 +317,12 @@ describe API::Pipelines do expect do post api("/projects/#{project.id}/pipeline", user), ref: project.default_branch, variables: variables end.to change { project.pipelines.count }.by(1) + expect_variables(project.pipelines.last.variables, variables) expect(response).to have_gitlab_http_status(201) expect(json_response).to be_a Hash expect(json_response['sha']).to eq project.commit.id - expect(json_response['variables']).to eq variables + expect(json_response).not_to have_key('variables') end end @@ -328,11 +338,12 @@ describe API::Pipelines do expect do post api("/projects/#{project.id}/pipeline", user), ref: project.default_branch, variables: variables end.to change { project.pipelines.count }.by(1) + expect_variables(project.pipelines.last.variables, variables) expect(response).to have_gitlab_http_status(201) expect(json_response).to be_a Hash expect(json_response['sha']).to eq project.commit.id - expect(json_response['variables']).to eq variables + expect(json_response).not_to have_key('variables') end context 'condition unmatch' do |