From e3cd3407f42036ac5409480961486af28e2dfca3 Mon Sep 17 00:00:00 2001 From: Juno NISHIZAKI Date: Sun, 15 May 2022 07:38:55 +0000 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC23=E5=9B=9E=20helper=E3=81=AE=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/helpers/mailer_helper_test.rb | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 test/helpers/mailer_helper_test.rb diff --git a/test/helpers/mailer_helper_test.rb b/test/helpers/mailer_helper_test.rb new file mode 100644 index 000000000..5abfd8f85 --- /dev/null +++ b/test/helpers/mailer_helper_test.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Redmine - project management software +# Copyright (C) 2006-2022 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.expand_path('../../test_helper', __FILE__) + +class MailerHelperTest < Redmine::HelperTest + include MailerHelper + + fixtures :users + + # TODO: fix method name + def test_1 + recipients = [User.find(2), User.find(3)] + ret = show_recipients recipients + assert_equal 'John Smith, Dave Lopper', ret + end + + def test_2 + with_settings :show_recipients_limit => 3 do + recipients = User.all.to_a + ret = show_recipients recipients + assert_equal 'Redmine Admin, John Smith, Dave Lopper...', ret + end + end + +end \ No newline at end of file