summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-05-04 13:31:20 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-05-04 13:31:20 +0200
commit3417221ee6d3b8b0b6a895821a9fdff307359063 (patch)
tree7bbb653a721ffe8d3645e9cff4a813b07eabc7b4
parentc6e394bb8499b470b9d2a0c03c8ce7fd023fa08a (diff)
downloadgitlab-ce-3417221ee6d3b8b0b6a895821a9fdff307359063.tar.gz
Add pipeline variables feature spec
-rw-r--r--spec/features/projects/pipelines/pipelines_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb
index 6e63e0f0b49..d404bc66ba8 100644
--- a/spec/features/projects/pipelines/pipelines_spec.rb
+++ b/spec/features/projects/pipelines/pipelines_spec.rb
@@ -522,6 +522,21 @@ describe 'Pipelines', :js do
expect(Ci::Pipeline.last).to be_web
end
+
+ context 'when variables are specified' do
+ it 'creates a new pipeline with variables' do
+ page.within '.ci-variable-row-body' do
+ fill_in "Input variable key", with: "key_name"
+ fill_in "Input variable value", with: "value"
+ end
+
+ expect { click_on 'Create pipeline' }
+ .to change { Ci::Pipeline.count }.by(1)
+
+ expect(Ci::Pipeline.last.variables.map { |var| var.slice(:key, :secret_value) })
+ .to eq [{ key: "key_name", secret_value: "value" }.with_indifferent_access]
+ end
+ end
end
context 'without gitlab-ci.yml' do