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
88984137
Commit
88984137
authored
Feb 22, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix false positive spec
parent
f7947edd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
ee/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb
...ared_examples/uploaders/object_storage_shared_examples.rb
+16
-3
No files found.
ee/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb
View file @
88984137
...
...
@@ -20,6 +20,19 @@ shared_examples "migrates" do |to_store:, from_store: nil|
migrate
(
from
)
end
it
'returns corresponding file type'
do
expect
(
subject
).
to
be_an
(
CarrierWave
::
Uploader
::
Base
)
expect
(
subject
).
to
be_a
(
ObjectStorage
::
Concern
)
if
from
==
described_class
::
Store
::
REMOTE
expect
(
subject
.
file
).
to
be_a
(
CarrierWave
::
Storage
::
Fog
::
File
)
elsif
from
==
described_class
::
Store
::
LOCAL
expect
(
subject
.
file
).
to
be_a
(
CarrierWave
::
SanitizedFile
)
else
raise
'Enexpected file type'
end
end
it
'does nothing when migrating to the current store'
do
expect
{
migrate
(
from
)
}.
not_to
change
{
subject
.
object_store
}.
from
(
from
)
end
...
...
@@ -39,13 +52,13 @@ shared_examples "migrates" do |to_store:, from_store: nil|
end
it
'can access to the original file during migration'
do
original_file
=
subject
.
file
.
path
file
=
subject
.
file
allow
(
subject
).
to
receive
(
:delete_migrated_file
)
{
}
# Remove as a callback of :migrate
allow
(
subject
).
to
receive
(
:record_upload
)
{
}
# Remove as a callback of :store (:record_upload)
expect
(
File
.
exist?
(
original_file
)
).
to
be_truthy
expect
{
migrate
(
to
)
}.
not_to
change
{
File
.
exist?
(
original_file
)
}
expect
(
file
.
exists?
).
to
be_truthy
expect
{
migrate
(
to
)
}.
not_to
change
{
file
.
exists?
}
end
context
'when migrate! is not oqqupied by another process'
do
...
...
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