|
|
|
@ -36,6 +36,8 @@ describe WorkPackagesController, type: :controller do |
|
|
|
|
before do |
|
|
|
|
allow(User).to receive(:current).and_return user |
|
|
|
|
expect(controller).to receive(:authorize).and_return(true) |
|
|
|
|
expect(Setting).to receive(:notified_events).and_return ['work_package_added', |
|
|
|
|
'work_package_updated'] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
around(:each) do |example| |
|
|
|
@ -73,9 +75,7 @@ describe WorkPackagesController, type: :controller do |
|
|
|
|
# Find the enqueued job responsible for sending the notification |
|
|
|
|
# for the creation of the work package. |
|
|
|
|
Delayed::Job.all.map(&:payload_object).detect do |job| |
|
|
|
|
if job.is_a? EnqueueWorkPackageNotificationJob |
|
|
|
|
job.send(:work_package) == work_package |
|
|
|
|
end |
|
|
|
|
job.is_a?(EnqueueWorkPackageNotificationJob) && job.send(:work_package) == work_package |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|