# frozen_string_literal: true require "spec_helper" RSpec.describe "admin/shared/_attachment_field.html.haml" do include FileHelper let(:enterprise) { create(:distributor_enterprise, white_label_logo: black_logo_file) } let(:f) { ActionView::Helpers::FormBuilder.new(:enterprise, enterprise, view, {}) } it "includes a preview of the image if one was already uploaded" do allow(view).to receive_messages( attachment_name: :white_label_logo, attachment_url: enterprise.white_label_logo_url, f: ) render expect(rendered).to include("