# frozen_string_literal: true
require 'rails_helper'
RSpec.describe AccountLogo do
describe '.sanitize_svg' do
it 'removes
SVG
cleaned = described_class.sanitize_svg(svg)
expect(cleaned).not_to include(''
file = ActionDispatch::Http::UploadedFile.new(
tempfile: Tempfile.new(['logo', '.svg']).tap do |t|
t.write(svg)
t.rewind
end,
filename: 'logo.svg', type: 'image/svg+xml'
)
result = described_class.sanitize_upload(file)
expect(result.content_type).to eq('image/svg+xml')
body = result.io.read
expect(body).not_to include('