summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-29 12:12:57 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-30 10:44:18 +0200
commit0b8cefd3b2385a21cfed779bd659978c0402766d (patch)
tree9c4753cc8a610c153fb64e99dd619f3b8f0fc4d8 /app/uploaders
parent701976e0815c273ff4a4c6e4d3489db0ce2f0860 (diff)
downloadgitlab-ce-0b8cefd3b2385a21cfed779bd659978c0402766d.tar.gz
Get FileUploader into test harness using factory
This attempts to get CarrierWave's uploader - `FileUploader` into test harness using a factory. that makes it easier to build an instance of it. Along with !3435 it may be easier to use uploaders in tests
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/file_uploader.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index ac719f74f6a..25d879ff449 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -7,9 +7,9 @@ class FileUploader < CarrierWave::Uploader::Base
attr_accessor :project, :secret
- def initialize(project, secret = self.class.generate_secret)
+ def initialize(project, secret = nil)
@project = project
- @secret = secret
+ @secret = secret || self.class.generate_secret
end
def base_dir