debian-mirror-gitlab/spec/uploaders/uploader_helper_spec.rb

21 lines
433 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'rails_helper'
describe UploaderHelper do
let(:uploader) do
example_uploader = Class.new(CarrierWave::Uploader::Base) do
include UploaderHelper
storage :file
end
example_uploader.new
end
2018-11-20 20:47:30 +05:30
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-08-17 22:00:37 +05:30
end
end
end