2019-10-14 23:06:19 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2017-02-23 16:54:25 -05:00
|
|
|
|
|
|
|
describe UploaderHelper do
|
2017-02-15 13:11:44 -05:00
|
|
|
let(:uploader) do
|
|
|
|
example_uploader = Class.new(CarrierWave::Uploader::Base) do
|
|
|
|
include UploaderHelper
|
2017-02-23 16:54:25 -05:00
|
|
|
|
2017-02-15 13:11:44 -05:00
|
|
|
storage :file
|
|
|
|
end
|
|
|
|
|
|
|
|
example_uploader.new
|
2017-02-23 16:54:25 -05:00
|
|
|
end
|
|
|
|
|
2018-09-04 06:39:08 -04:00
|
|
|
describe '#extension_match?' do
|
|
|
|
it 'returns false if file does not exists' do
|
|
|
|
expect(uploader.file).to be_nil
|
|
|
|
expect(uploader.send(:extension_match?, 'jpg')).to eq false
|
2017-02-23 16:54:25 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|