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

22 lines
625 B

FactoryBot.define do
factory :notification do
subject { "MyText" }
read_ian { false }
read_mail { false }
read_mail_digest { false }
reason_ian { :mentioned }
reason_mail { :involved }
reason_mail_digest { :watched }
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