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
cfefab85
Commit
cfefab85
authored
Dec 11, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regression tests
parent
d69f699e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
ee/spec/lib/gitlab/checks/diff_check_spec.rb
ee/spec/lib/gitlab/checks/diff_check_spec.rb
+22
-1
No files found.
ee/spec/lib/gitlab/checks/diff_check_spec.rb
View file @
cfefab85
...
...
@@ -78,9 +78,10 @@ describe Gitlab::Checks::DiffCheck do
context
'file lock rules'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:path_lock
)
{
create
(
:path_lock
,
path:
'README'
,
project:
project
)
}
it
'returns an error if the changes update a path locked by another user'
do
path_lock
=
create
(
:path_lock
,
path:
'README'
,
project:
project
)
path_lock
expect
{
subject
.
validate!
}.
to
raise_error
(
Gitlab
::
GitAccess
::
UnauthorizedError
,
"The path 'README' is locked by
#{
path_lock
.
user
.
name
}
"
)
end
...
...
@@ -90,6 +91,26 @@ describe Gitlab::Checks::DiffCheck do
2
.
times
{
subject
.
validate!
}
end
context
'when the branch is being deleted'
do
let
(
:newrev
)
{
Gitlab
::
Git
::
BLANK_SHA
}
it
'does not run'
do
path_lock
expect
{
subject
.
validate!
}.
not_to
raise_error
end
end
context
'when there is no valid change'
do
let
(
:changes
)
{
{
oldrev:
'_any'
,
newrev:
nil
,
ref:
nil
}
}
it
'does not run'
do
path_lock
expect
{
subject
.
validate!
}.
not_to
raise_error
end
end
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