debian-mirror-gitlab/spec/uploaders/uploader_helper_spec.rb
2020-06-23 00:09:42 +05:30

22 lines
462 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe UploaderHelper do
let(:uploader) do
example_uploader = Class.new(CarrierWave::Uploader::Base) do
include UploaderHelper
storage :file
end
example_uploader.new
end
describe '#extension_match?' do
it 'returns false if file does not exist' do
expect(uploader.file).to be_nil
expect(uploader.send(:extension_match?, 'jpg')).to eq false
end
end
end