mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adds traits to enterprise_factory and spec
This commit is contained in:
@@ -23,6 +23,14 @@ FactoryBot.define do
|
||||
end
|
||||
end
|
||||
|
||||
trait :with_logo_image do
|
||||
logo { Rack::Test::UploadedFile.new('spec/fixtures/files/logo.png', 'image/png') }
|
||||
end
|
||||
|
||||
trait :with_promo_image do
|
||||
logo { Rack::Test::UploadedFile.new('spec/fixtures/files/promo.png', 'image/png') }
|
||||
end
|
||||
|
||||
factory :supplier_enterprise, parent: :enterprise do
|
||||
is_primary_producer { true }
|
||||
sells { "none" }
|
||||
|
||||
@@ -225,7 +225,7 @@ describe SubscriptionMailer, type: :mailer do
|
||||
end
|
||||
|
||||
describe "order placement summary" do
|
||||
let!(:shop) { create(:enterprise) }
|
||||
let!(:shop) { create(:enterprise, :with_logo_image) }
|
||||
let!(:summary) { double(:summary, shop_id: shop.id) }
|
||||
let(:body) { strip_tags(SubscriptionMailer.deliveries.last.body.encoded) }
|
||||
let(:scope) { "subscription_mailer" }
|
||||
|
||||
Reference in New Issue
Block a user