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
a5bb17ff
Commit
a5bb17ff
authored
Feb 01, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
porting changes from upstream
parent
c614089d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
17 deletions
+5
-17
app/uploaders/gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+2
-2
spec/factories/groups.rb
spec/factories/groups.rb
+1
-1
spec/factories/projects.rb
spec/factories/projects.rb
+1
-1
spec/factories/users.rb
spec/factories/users.rb
+1
-1
spec/uploaders/attachment_uploader_spec.rb
spec/uploaders/attachment_uploader_spec.rb
+0
-12
No files found.
app/uploaders/gitlab_uploader.rb
View file @
a5bb17ff
...
@@ -35,12 +35,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
...
@@ -35,12 +35,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
# Reduce disk IO
# Reduce disk IO
def
move_to_cache
def
move_to_cache
super
.
nil?
?
true
:
super
file_storage?
end
end
# Reduce disk IO
# Reduce disk IO
def
move_to_store
def
move_to_store
super
.
nil?
?
true
:
super
file_storage?
end
end
def
exists?
def
exists?
...
...
spec/factories/groups.rb
View file @
a5bb17ff
...
@@ -18,7 +18,7 @@ FactoryBot.define do
...
@@ -18,7 +18,7 @@ FactoryBot.define do
end
end
trait
:with_avatar
do
trait
:with_avatar
do
avatar
{
File
.
open
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
)
)
}
avatar
{
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
end
end
trait
:access_requestable
do
trait
:access_requestable
do
...
...
spec/factories/projects.rb
View file @
a5bb17ff
...
@@ -90,7 +90,7 @@ FactoryBot.define do
...
@@ -90,7 +90,7 @@ FactoryBot.define do
end
end
trait
:with_avatar
do
trait
:with_avatar
do
avatar
{
File
.
open
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
)
)
}
avatar
{
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
end
end
trait
:broken_storage
do
trait
:broken_storage
do
...
...
spec/factories/users.rb
View file @
a5bb17ff
...
@@ -38,7 +38,7 @@ FactoryBot.define do
...
@@ -38,7 +38,7 @@ FactoryBot.define do
end
end
trait
:with_avatar
do
trait
:with_avatar
do
avatar
{
File
.
open
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
)
)
}
avatar
{
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
end
end
trait
:two_factor_via_otp
do
trait
:two_factor_via_otp
do
...
...
spec/uploaders/attachment_uploader_spec.rb
View file @
a5bb17ff
...
@@ -11,16 +11,4 @@ describe AttachmentUploader do
...
@@ -11,16 +11,4 @@ describe AttachmentUploader do
store_dir:
%r[uploads/-/system/note/attachment/]
,
store_dir:
%r[uploads/-/system/note/attachment/]
,
upload_path:
%r[uploads/-/system/note/attachment/]
,
upload_path:
%r[uploads/-/system/note/attachment/]
,
absolute_path:
%r[
#{
CarrierWave
.
root
}
/uploads/-/system/note/attachment/]
absolute_path:
%r[
#{
CarrierWave
.
root
}
/uploads/-/system/note/attachment/]
describe
'#move_to_cache'
do
it
'is true'
do
expect
(
uploader
.
move_to_cache
).
to
eq
(
true
)
end
end
describe
'#move_to_store'
do
it
'is true'
do
expect
(
uploader
.
move_to_store
).
to
eq
(
true
)
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