Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-02-24 00:54:25 +0300
committerRobert Speicher <rspeicher@gmail.com>2017-02-25 00:41:27 +0300
commita8c62dfe5c01ed08f170c1d41a39d5167b09631b (patch)
tree9c25e207356ebc7b2b88f3c0a7cd0e9374f571c8 /spec/uploaders/avatar_uploader_spec.rb
parent1f8d6c790a8493a341f1786710aac36621e93bf6 (diff)
Minor refactoring of Uploaders
- Moves a duplicate `file_storage?` definition into the common `GitlabUploader` ancestor. - Get the `uploads` base directory from a class method rather than hard-coding it where it's needed. This will be used in a subsequent MR to store Uploads in the database. - Improves the specs for uploaders.
Diffstat (limited to 'spec/uploaders/avatar_uploader_spec.rb')
-rw-r--r--spec/uploaders/avatar_uploader_spec.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/uploaders/avatar_uploader_spec.rb b/spec/uploaders/avatar_uploader_spec.rb
index 76f5a4b42ed..c4d558805ab 100644
--- a/spec/uploaders/avatar_uploader_spec.rb
+++ b/spec/uploaders/avatar_uploader_spec.rb
@@ -1,18 +1,17 @@
require 'spec_helper'
describe AvatarUploader do
- let(:user) { build(:user) }
- subject { described_class.new(user) }
+ let(:uploader) { described_class.new(build_stubbed(:user)) }
describe '#move_to_cache' do
it 'is false' do
- expect(subject.move_to_cache).to eq(false)
+ expect(uploader.move_to_cache).to eq(false)
end
end
describe '#move_to_store' do
it 'is false' do
- expect(subject.move_to_store).to eq(false)
+ expect(uploader.move_to_store).to eq(false)
end
end
end