From f4973498bee6ceba412404484aa521ef98bd9b6b Mon Sep 17 00:00:00 2001 From: karim-semmoud Date: Tue, 13 Jun 2023 11:47:22 +0200 Subject: [PATCH] Add budget image to Budget and image factories and model --- spec/factories/files.rb | 4 ++++ spec/models/budget_spec.rb | 1 + spec/models/image_spec.rb | 1 + 3 files changed, 6 insertions(+) diff --git a/spec/factories/files.rb b/spec/factories/files.rb index 5876c90c8..5aa2a9295 100644 --- a/spec/factories/files.rb +++ b/spec/factories/files.rb @@ -8,6 +8,10 @@ FactoryBot.define do association :imageable, factory: :proposal end + trait :budget_image do + association :imageable, factory: :budget + end + trait :budget_investment_image do association :imageable, factory: :budget_investment end diff --git a/spec/models/budget_spec.rb b/spec/models/budget_spec.rb index 79415f512..ff1ae010e 100644 --- a/spec/models/budget_spec.rb +++ b/spec/models/budget_spec.rb @@ -6,6 +6,7 @@ describe Budget do it_behaves_like "sluggable", updatable_slug_trait: :drafting it_behaves_like "reportable" it_behaves_like "globalizable", :budget + it_behaves_like "acts as imageable", :budget_image describe "scopes" do describe ".open" do diff --git a/spec/models/image_spec.rb b/spec/models/image_spec.rb index 6b4603923..dc1a908bc 100644 --- a/spec/models/image_spec.rb +++ b/spec/models/image_spec.rb @@ -2,6 +2,7 @@ require "rails_helper" describe Image do it_behaves_like "image validations", "budget_investment_image" + it_behaves_like "image validations", "budget_image" it_behaves_like "image validations", "proposal_image" it "stores attachments with Active Storage" do