diff --git a/app/models/user.rb b/app/models/user.rb index cd923e46b..c5eca4035 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -75,7 +75,7 @@ class User < Principal MAIL_NOTIFICATION_OPTIONS = [ ['all', :label_user_mail_option_all], ['selected', :label_user_mail_option_selected], - ['bookmarked', :label_user_mail_option_bookmarked], + ['bookmarked', :label_user_mail_option_bookmarked_my_projects], ['only_my_events', :label_user_mail_option_only_my_events], ['only_assigned', :label_user_mail_option_only_assigned], ['only_owner', :label_user_mail_option_only_owner], diff --git a/config/locales/en.yml b/config/locales/en.yml index 672d4d530..48494f688 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -942,7 +942,7 @@ en: label_search_titles_only: Search titles only label_user_mail_option_all: "For any event on all my projects" label_user_mail_option_selected: "For any event on the selected projects only..." - label_user_mail_option_bookmarked: "For any event on my bookmarked projects" + label_user_mail_option_bookmarked_my_projects: "For any events on bookmarked my projects" label_user_mail_option_none: "No events" label_user_mail_option_only_my_events: "Only for things I watch or I'm involved in" label_user_mail_option_only_assigned: "Only for things I watch or I am assigned to" diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index d585da1d7..f1cbfa8e0 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -1045,8 +1045,16 @@ class ProjectTest < ActiveSupport::TestCase only_my_events_user = User.generate!(:mail_notification => 'only_my_events') Member.create!(:project => project, :roles => [role], :principal => only_my_events_user) - bookmarked_user = User.generate!(:mail_notification => 'bookmarked') - Member.create!(:project => project, :roles => [role], :principal => bookmarked_user) + bookmarked_and_member_user = User.generate!(:mail_notification => 'bookmarked') + Member.create!(:project => project, :roles => [role], :principal => bookmarked_and_member_user) + pjb = Redmine::ProjectJumpBox.new bookmarked_and_member_user + pjb.bookmark_project project + bookmarked_and_member_user.update_notified_bookmarked_project_ids(project) + + bookmarked_and_nonmember_user = User.generate!(:mail_notification => 'bookmarked') + pjb = Redmine::ProjectJumpBox.new bookmarked_and_nonmember_user + pjb.bookmark_project project + bookmarked_and_member_user.update_notified_bookmarked_project_ids(project) only_assigned_user = User.generate!(:mail_notification => 'only_assigned') Member.create!(:project => project, :roles => [role], :principal => only_assigned_user) @@ -1062,10 +1070,12 @@ class ProjectTest < ActiveSupport::TestCase "should not include users with the 'none' notification option" assert !project.notified_users.include?(only_my_events_user), "should not include users with the 'only_my_events' notification option" - assert !project.notified_users.include?(bookmarked_user), - "should not include users with the 'bookmarked' notification option" + assert project.notified_users.include?(bookmarked_and_member_user), + "should include users with the 'bookmarked' notification option" + assert !project.notified_users.include?(bookmarked_and_nonmember_user), + "should not include member users with the 'bookmarked' notification option" assert !project.notified_users.include?(only_assigned_user), - "should not include users with the 'only_assigned' notification option" + "should not include non-member users with the 'only_assigned' notification option" assert !project.notified_users.include?(only_owned_user), "should not include users with the 'only_owner' notification option" end