Base uploader tests
This commit is contained in:
parent
b03b02371f
commit
a6ff698cf8
1 changed files with 30 additions and 0 deletions
30
spec/uploaders/base_uploader_spec.rb
Normal file
30
spec/uploaders/base_uploader_spec.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe BaseUploader do
|
||||
let(:uploader) { described_class.new }
|
||||
|
||||
describe '#cache_dir' do
|
||||
|
||||
subject { uploader.cache_dir }
|
||||
|
||||
context 'when rails env is not production' do
|
||||
it { is_expected.to eq '/tmp/tps-dev-cache' }
|
||||
end
|
||||
|
||||
context 'when rails env is not production' do
|
||||
before do
|
||||
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
|
||||
end
|
||||
|
||||
it { is_expected.to eq '/tmp/tps-cache' }
|
||||
|
||||
context 'when is opensimplif' do
|
||||
before do
|
||||
allow(Features).to receive(:opensimplif?).and_return(true)
|
||||
end
|
||||
|
||||
it { is_expected.to eq '/tmp/opensimplif-cache' }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue