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
591 B

FactoryBot.define do
factory :notification do
subject { "MyText" } # rubocop:disable RSpec/EmptyLineAfterSubject
read_ian { false }
mail_reminder_sent { false }
mail_alert_sent { false }
reason { :mentioned }
recipient factory: :user
project { association :project }
resource { association :work_package, project: project }
actor { nil }
journal { nil }
callback(:after_build) do |notification, _|
notification.journal ||= notification.resource.journals.last
notification.actor ||= notification.journal.try(:user)
end
end
end