gitlab-org--gitlab-foss/spec/uploaders/avatar_uploader_spec.rb

29 lines
705 B
Ruby
Raw Normal View History

2016-08-18 14:31:44 +00:00
require 'spec_helper'
describe AvatarUploader do
let(:uploader) { described_class.new(build_stubbed(:user)) }
2016-08-18 14:31:44 +00:00
describe "#store_dir" do
it "stores in the system dir" do
2017-07-17 13:46:59 +00:00
expect(uploader.store_dir).to start_with("uploads/-/system/user")
end
it "uses the old path when using object storage" do
expect(described_class).to receive(:file_storage?).and_return(false)
expect(uploader.store_dir).to start_with("uploads/user")
end
end
2016-08-18 14:31:44 +00:00
describe '#move_to_cache' do
2017-01-02 11:35:15 +00:00
it 'is false' do
expect(uploader.move_to_cache).to eq(false)
2016-08-18 14:31:44 +00:00
end
end
describe '#move_to_store' do
2017-01-02 11:35:15 +00:00
it 'is false' do
expect(uploader.move_to_store).to eq(false)
2016-08-18 14:31:44 +00:00
end
end
end