OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/factories/notification_factory.rb

19 lines
525 B

FactoryBot.define do
factory :notification do
subject { "MyText" }
read_ian { false }
read_email { false }
reason { :mentioned }
recipient factory: :user
project { association :project }
resource { association :work_package, project: project }
actor { journal.try(:user) }
transient { journal }
callback(:after_create) do |notification, evaluator|
notification.journal = evaluator.journal || notification.work_package.journals.last
notification.save!
end
end
end