summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorJacopo <beschi.jacopo@gmail.com>2018-06-05 21:57:29 +0200
committerJacopo <beschi.jacopo@gmail.com>2018-06-05 21:57:29 +0200
commit46317b7dabd585bed42cf9c0008a7c69c080d33f (patch)
tree81e1468fdc061b45232b67537bb8181975015157 /spec/requests
parent3871ea33ca524ef2d420a4ff311d8535622bd150 (diff)
downloadgitlab-ce-46317b7dabd585bed42cf9c0008a7c69c080d33f.tar.gz
Removes variables from pipelines api
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/pipelines_spec.rb15
1 files changed, 13 insertions, 2 deletions
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