BigW Consortium Gitlab

avatar_uploader_spec.rb 705 Bytes
Newer Older
1 2 3
require 'spec_helper'

describe AvatarUploader do
4
  let(:uploader) { described_class.new(build_stubbed(:user)) }
5

6 7
  describe "#store_dir" do
    it "stores in the system dir" do
8
      expect(uploader.store_dir).to start_with("uploads/-/system/user")
9 10 11 12 13 14 15 16
    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

17
  describe '#move_to_cache' do
18
    it 'is false' do
19
      expect(uploader.move_to_cache).to eq(false)
20 21 22 23
    end
  end

  describe '#move_to_store' do
24
    it 'is false' do
25
      expect(uploader.move_to_store).to eq(false)
26 27 28
    end
  end
end