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
ecc8326b
Commit
ecc8326b
authored
Feb 05, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the Upload#store not being updated upon migration
parent
a50ab5e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
51 deletions
+4
-51
ee/app/uploaders/object_storage.rb
ee/app/uploaders/object_storage.rb
+4
-2
spec/support/shared_examples/uploaders/object_storage_shared_examples.rb
...ared_examples/uploaders/object_storage_shared_examples.rb
+0
-49
No files found.
ee/app/uploaders/object_storage.rb
View file @
ecc8326b
...
...
@@ -37,8 +37,10 @@ module ObjectStorage
super
end
def
build_upload_from_uploader
(
uploader
)
super
.
tap
{
|
upload
|
upload
.
store
=
object_store
}
def
build_upload
super
.
tap
do
|
upload
|
upload
.
store
=
object_store
end
end
def
upload
=
(
upload
)
...
...
spec/support/shared_examples/uploaders/object_storage_shared_examples.rb
View file @
ecc8326b
...
...
@@ -75,52 +75,3 @@ shared_examples "migrates" do |to_store:, from_store: nil|
end
end
end
shared_examples
"matches the method pattern"
do
|
method
|
let
(
:target
)
{
subject
}
let
(
:args
)
{
nil
}
let
(
:pattern
)
{
patterns
[
method
]
}
it
do
return
skip
"No pattern provided, skipping."
unless
pattern
expect
(
target
.
method
(
method
).
call
(
*
args
)).
to
match
(
pattern
)
end
end
shared_examples
"builds correct paths"
do
|**
patterns
|
let
(
:patterns
)
{
patterns
}
before
do
allow
(
subject
).
to
receive
(
:filename
).
and_return
(
'<filename>'
)
end
describe
"#store_dir"
do
it_behaves_like
"matches the method pattern"
,
:store_dir
end
describe
"#cache_dir"
do
it_behaves_like
"matches the method pattern"
,
:cache_dir
end
describe
"#work_dir"
do
it_behaves_like
"matches the method pattern"
,
:work_dir
end
describe
"#upload_path"
do
it_behaves_like
"matches the method pattern"
,
:upload_path
end
describe
".absolute_path"
do
it_behaves_like
"matches the method pattern"
,
:absolute_path
do
let
(
:target
)
{
subject
.
class
}
let
(
:args
)
{
[
upload
]
}
end
end
describe
".base_dir"
do
it_behaves_like
"matches the method pattern"
,
:base_dir
do
let
(
:target
)
{
subject
.
class
}
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