lib/decidim/dev/test/factories.rb in decidim-dev-0.28.1 vs lib/decidim/dev/test/factories.rb in decidim-dev-0.28.2
- old
+ new
@@ -33,9 +33,15 @@
create(:endorsement, resource:, skip_injection: evaluator.skip_injection,
author: build(:user, organization: resource.component.organization, skip_injection: evaluator.skip_injection))
end
end
end
+
+ trait :moderated do
+ after(:create) do |resource, evaluator|
+ create(:moderation, reportable: resource, hidden_at: 2.days.ago, skip_injection: evaluator.skip_injection)
+ end
+ end
end
factory :nested_dummy_resource, class: "Decidim::Dev::NestedDummyResource" do
transient do
skip_injection { false }