gitlab-org--gitlab-foss/spec/uploaders/favicon_uploader_spec.rb
Rémy Coutable 0f90c1fd73
Don't use Rails.root.join for upload fixture paths
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-06-11 13:54:25 +02:00

29 lines
605 B
Ruby

require 'spec_helper'
RSpec.describe FaviconUploader do
include CarrierWave::Test::Matchers
let(:uploader) { described_class.new(build_stubbed(:user)) }
after do
uploader.remove!
end
def upload_fixture(filename)
fixture_file_upload("spec/fixtures/#{filename}")
end
context 'versions' do
before do
uploader.store!(upload_fixture('dk.png'))
end
it 'has the correct format' do
expect(uploader.favicon_main).to be_format('png')
end
it 'has the correct dimensions' do
expect(uploader.favicon_main).to have_dimensions(32, 32)
end
end
end