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
b475d42d
Commit
b475d42d
authored
Nov 08, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve conflicts in spec/lib/gitlab/checks/change_access_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
efe97c75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
48 deletions
+45
-48
spec/lib/gitlab/checks/change_access_spec.rb
spec/lib/gitlab/checks/change_access_spec.rb
+45
-48
No files found.
spec/lib/gitlab/checks/change_access_spec.rb
View file @
b475d42d
...
...
@@ -10,12 +10,8 @@ describe Gitlab::Checks::ChangeAccess do
let
(
:ref
)
{
'refs/heads/master'
}
let
(
:changes
)
{
{
oldrev:
oldrev
,
newrev:
newrev
,
ref:
ref
}
}
let
(
:protocol
)
{
'ssh'
}
<<<<<<<
HEAD
let
(
:change_access
)
do
=======
subject
(
:change_access
)
do
>>>>>>>
upstream
/
master
described_class
.
new
(
changes
,
project:
project
,
...
...
@@ -170,7 +166,51 @@ describe Gitlab::Checks::ChangeAccess do
end
end
<<<<<<<
HEAD
context
'LFS integrity check'
do
let
(
:blob_object
)
{
project
.
repository
.
blob_at_branch
(
'lfs'
,
'files/lfs/lfs_object.iso'
)
}
before
do
allow_any_instance_of
(
Gitlab
::
Git
::
RevList
).
to
receive
(
:new_objects
)
do
|&
lazy_block
|
lazy_block
.
call
([
blob_object
.
id
])
end
end
context
'with LFS not enabled'
do
it
'skips integrity check'
do
expect_any_instance_of
(
Gitlab
::
Git
::
RevList
).
not_to
receive
(
:new_objects
)
subject
.
exec
end
end
context
'with LFS enabled'
do
before
do
allow
(
project
).
to
receive
(
:lfs_enabled?
).
and_return
(
true
)
end
context
'deletion'
do
let
(
:changes
)
{
{
oldrev:
oldrev
,
ref:
ref
}
}
it
'skips integrity check'
do
expect_any_instance_of
(
Gitlab
::
Git
::
RevList
).
not_to
receive
(
:new_objects
)
subject
.
exec
end
end
it
'fails if any LFS blobs are missing'
do
expect
{
subject
.
exec
}.
to
raise_error
(
Gitlab
::
GitAccess
::
UnauthorizedError
,
/LFS objects are missing/
)
end
it
'succeeds if LFS objects have already been uploaded'
do
lfs_object
=
create
(
:lfs_object
,
oid:
blob_object
.
lfs_oid
)
create
(
:lfs_objects_project
,
project:
project
,
lfs_object:
lfs_object
)
expect
{
subject
.
exec
}.
not_to
raise_error
end
end
end
context
'push rules checks'
do
shared_examples
'check ignored when push rule unlicensed'
do
before
do
...
...
@@ -543,49 +583,6 @@ describe Gitlab::Checks::ChangeAccess do
expect
(
change_access
).
to
receive
(
:committer_check
).
once
.
and_call_original
expect
{
subject
}.
not_to
raise_error
=======
context
'LFS integrity check'
do
let
(
:blob_object
)
{
project
.
repository
.
blob_at_branch
(
'lfs'
,
'files/lfs/lfs_object.iso'
)
}
before
do
allow_any_instance_of
(
Gitlab
::
Git
::
RevList
).
to
receive
(
:new_objects
)
do
|&
lazy_block
|
lazy_block
.
call
([
blob_object
.
id
])
end
end
context
'with LFS not enabled'
do
it
'skips integrity check'
do
expect_any_instance_of
(
Gitlab
::
Git
::
RevList
).
not_to
receive
(
:new_objects
)
subject
.
exec
end
end
context
'with LFS enabled'
do
before
do
allow
(
project
).
to
receive
(
:lfs_enabled?
).
and_return
(
true
)
end
context
'deletion'
do
let
(
:changes
)
{
{
oldrev:
oldrev
,
ref:
ref
}
}
it
'skips integrity check'
do
expect_any_instance_of
(
Gitlab
::
Git
::
RevList
).
not_to
receive
(
:new_objects
)
subject
.
exec
end
end
it
'fails if any LFS blobs are missing'
do
expect
{
subject
.
exec
}.
to
raise_error
(
Gitlab
::
GitAccess
::
UnauthorizedError
,
/LFS objects are missing/
)
end
it
'succeeds if LFS objects have already been uploaded'
do
lfs_object
=
create
(
:lfs_object
,
oid:
blob_object
.
lfs_oid
)
create
(
:lfs_objects_project
,
project:
project
,
lfs_object:
lfs_object
)
expect
{
subject
.
exec
}.
not_to
raise_error
>>>>>>>
upstream
/
master
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