BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
71270f80
Unverified
Commit
71270f80
authored
Aug 25, 2016
by
Lukáš Nový
Committed by
Rémy Coutable
Feb 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI: Allow a project variable to be set to an empty value
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
459a97d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
8 deletions
+42
-8
_form.html.haml
app/views/projects/variables/_form.html.haml
+1
-1
lnovy-gitlab-ce-empty-variables.yml
changelogs/unreleased/lnovy-gitlab-ce-empty-variables.yml
+4
-0
variables_spec.rb
spec/features/variables_spec.rb
+37
-7
No files found.
app/views/projects/variables/_form.html.haml
View file @
71270f80
...
...
@@ -6,5 +6,5 @@
=
f
.
text_field
:key
,
class:
"form-control"
,
placeholder:
"PROJECT_VARIABLE"
,
required:
true
.form-group
=
f
.
label
:value
,
"Value"
,
class:
"label-light"
=
f
.
text_area
:value
,
class:
"form-control"
,
placeholder:
"PROJECT_VARIABLE"
,
required:
true
=
f
.
text_area
:value
,
class:
"form-control"
,
placeholder:
"PROJECT_VARIABLE"
=
f
.
submit
btn_text
,
class:
"btn btn-save"
changelogs/unreleased/lnovy-gitlab-ce-empty-variables.yml
0 → 100644
View file @
71270f80
---
title
:
'
UI:
Allow
a
project
variable
to
be
set
to
an
empty
value'
merge_request
:
6044
author
:
Lukáš Nový
spec/features/variables_spec.rb
View file @
71270f80
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
'Project variables'
,
js:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:variable
)
{
create
(
:ci_variable
,
key:
'test'
)
}
let
(
:variable
)
{
create
(
:ci_variable
,
key:
'test
_key'
,
value:
'test value
'
)
}
before
do
login_as
(
user
)
...
...
@@ -16,16 +16,28 @@ describe 'Project variables', js: true do
it
'shows list of variables'
do
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
variable
.
key
)
expect
(
page
).
to
have_content
(
variable
.
value
)
end
end
it
'adds new variable'
do
fill_in
(
'variable_key'
,
with:
'key'
)
fill_in
(
'variable_value'
,
with:
'
key
value'
)
fill_in
(
'variable_key'
,
with:
'
new_
key'
)
fill_in
(
'variable_value'
,
with:
'
new
value'
)
click_button
(
'Add new variable'
)
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
'key'
)
expect
(
page
).
to
have_content
(
'new_key'
)
expect
(
page
).
to
have_content
(
'new value'
)
end
end
it
'adds empty variable'
do
fill_in
(
'variable_key'
,
with:
'new_key'
)
fill_in
(
'variable_value'
,
with:
''
)
click_button
(
'Add new variable'
)
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
'new_key'
)
end
end
...
...
@@ -68,12 +80,30 @@ describe 'Project variables', js: true do
end
expect
(
page
).
to
have_content
(
'Update variable'
)
fill_in
(
'variable_key'
,
with:
'key'
)
fill_in
(
'variable_value'
,
with:
'
key
value'
)
fill_in
(
'variable_key'
,
with:
'
new_
key'
)
fill_in
(
'variable_value'
,
with:
'
new
value'
)
click_button
(
'Save variable'
)
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
'key'
)
expect
(
page
).
not_to
have_content
(
variable
.
key
)
expect
(
page
).
not_to
have_content
(
variable
.
value
)
expect
(
page
).
to
have_content
(
'new_key'
)
expect
(
page
).
to
have_content
(
'new value'
)
end
end
it
'edits variable with empty value'
do
page
.
within
(
'.variables-table'
)
do
find
(
'.btn-variable-edit'
).
click
end
expect
(
page
).
to
have_content
(
'Update variable'
)
fill_in
(
'variable_value'
,
with:
''
)
click_button
(
'Save variable'
)
page
.
within
(
'.variables-table'
)
do
expect
(
page
).
to
have_content
(
variable
.
key
)
expect
(
page
).
not_to
have_content
(
variable
.
value
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment