2016-08-18 10:31:44 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe AvatarUploader do
|
2018-01-29 12:57:34 -05:00
|
|
|
let(:model) { create(:user, :with_avatar) }
|
|
|
|
let(:uploader) { described_class.new(model, :avatar) }
|
|
|
|
let(:upload) { create(:upload, model: model) }
|
2016-08-18 10:31:44 -04:00
|
|
|
|
2018-01-29 12:57:34 -05:00
|
|
|
subject { uploader }
|
2017-06-07 23:32:38 -04:00
|
|
|
|
2018-01-29 12:57:34 -05:00
|
|
|
it_behaves_like 'builds correct paths',
|
|
|
|
store_dir: %r[uploads/-/system/user/avatar/],
|
|
|
|
upload_path: %r[uploads/-/system/user/avatar/],
|
|
|
|
absolute_path: %r[#{CarrierWave.root}/uploads/-/system/user/avatar/]
|
2017-06-07 23:32:38 -04:00
|
|
|
|
2016-08-18 10:31:44 -04:00
|
|
|
describe '#move_to_cache' do
|
2017-01-02 06:35:15 -05:00
|
|
|
it 'is false' do
|
2017-02-23 16:54:25 -05:00
|
|
|
expect(uploader.move_to_cache).to eq(false)
|
2016-08-18 10:31:44 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#move_to_store' do
|
2017-01-02 06:35:15 -05:00
|
|
|
it 'is false' do
|
2017-02-23 16:54:25 -05:00
|
|
|
expect(uploader.move_to_store).to eq(false)
|
2016-08-18 10:31:44 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|