Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
05a5c123
Commit
05a5c123
authored
Feb 13, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Project variables validation specs
parent
3f52cee4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
ee/spec/models/ee/project_spec.rb
ee/spec/models/ee/project_spec.rb
+26
-0
No files found.
ee/spec/models/ee/project_spec.rb
View file @
05a5c123
...
...
@@ -19,6 +19,32 @@ describe Project do
it
{
is_expected
.
to
have_many
(
:audit_events
).
dependent
(
false
)
}
end
describe
'validations'
do
let
(
:project
)
{
build
(
:project
)
}
describe
'variables'
do
let
(
:first_variable
)
{
build
(
:ci_variable
,
key:
'test_key'
,
value:
'first'
,
environment_scope:
'prod'
,
project:
project
)
}
let
(
:second_variable
)
{
build
(
:ci_variable
,
key:
'test_key'
,
value:
'other'
,
environment_scope:
'other'
,
project:
project
)
}
before
do
project
.
variables
<<
first_variable
project
.
variables
<<
second_variable
end
context
'with duplicate variables with same environment scope'
do
before
do
project
.
variables
.
last
.
environment_scope
=
project
.
variables
.
first
.
environment_scope
end
it
{
expect
(
project
).
not_to
be_valid
}
end
context
'with same variable keys and different environment scope'
do
it
{
expect
(
project
).
to
be_valid
}
end
end
end
describe
'.mirrors_to_sync'
do
let
(
:timestamp
)
{
Time
.
now
}
...
...
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