diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml index 250f572c..0677f3bb 100644 --- a/.github/workflows/rubyonrails.yml +++ b/.github/workflows/rubyonrails.yml @@ -21,9 +21,9 @@ name: "GitHub CI" on: push: - branches: ["devel"] + branches: ["test"] pull_request: - branches: ["devel"] + branches: ["test"] jobs: plugin_tests: strategy: diff --git a/app/models/dmsf_mailer.rb b/app/models/dmsf_mailer.rb index 044c3f80..f3c907fb 100644 --- a/app/models/dmsf_mailer.rb +++ b/app/models/dmsf_mailer.rb @@ -166,18 +166,23 @@ class DmsfMailer < Mailer # force_notification = true => approval workflow's notifications def self.get_notify_users(project, file, force_notification: false) + puts ">>> self.get_notify_users" return [] unless project.active? - + puts ">>> ok1" # Notifications if (force_notification && Setting.notified_events.include?('dmsf_workflow_plural')) || (Setting.notified_events.include?('dmsf_legacy_notifications') && file&.notify?) + puts ">>> ok2" notify_members = project.members.active.select do |notify_member| notify_user = notify_member.user if notify_user == User.current && notify_user.pref.no_self_notified + puts ">>> nok1" false elsif notify_member.dmsf_mail_notification.nil? + puts ">>> #{notify_user.mail_notification}" case notify_user.mail_notification when 'all' + puts ">>> ok3" true when 'selected' notify_member.mail_notification? @@ -188,6 +193,7 @@ class DmsfMailer < Mailer when 'only_assigned' file.assigned? notify_user else + puts ">>> nok2" false end else diff --git a/test/unit/dmsf_mailer_test.rb b/test/unit/dmsf_mailer_test.rb index eadffa2f..aa671a64 100644 --- a/test/unit/dmsf_mailer_test.rb +++ b/test/unit/dmsf_mailer_test.rb @@ -105,6 +105,8 @@ class DmsfMailerTest < RedmineDmsf::Test::UnitTest def test_get_notify_users with_settings notified_events: ['dmsf_legacy_notifications'] do + puts ">>> #{Setting.notified_events}" + puts ">>> #{@file1.notify?}" users = DmsfMailer.get_notify_users(@project1, @file1) assert users.present? end