Bugzilla – Attachment 39353 Details for
Bug 14206
notices using non email templates can't be deleted from the staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14206 Adds two tests to t/db_dependent/Letters.t
Bug-14206-Adds-two-tests-to-tdbdependentLetterst.patch (text/plain), 2.58 KB, created by
Indranil Das Gupta
on 2015-05-21 01:13:34 UTC
(
hide
)
Description:
Bug 14206 Adds two tests to t/db_dependent/Letters.t
Filename:
MIME Type:
Creator:
Indranil Das Gupta
Created:
2015-05-21 01:13:34 UTC
Size:
2.58 KB
patch
obsolete
>From d21442337206d46cfe690310b0773a8fde880cc2 Mon Sep 17 00:00:00 2001 >From: Indranil Das Gupta <indradg@gmail.com> >Date: Thu, 21 May 2015 06:41:46 +0530 >Subject: [PATCH] Bug 14206 Adds two tests to t/db_dependent/Letters.t > >C4::Letters::getletter is called in tools/letter.pl by the function >delete_confirm() to display the selected notice for deletion. Due to >current implementation of getletter(), a notice that does not use >the 'email' template (but uses any/all of the other templates - sms, >print or phone) can't be deleted from the staff client. > >This patch adds 2 tests to t/db_dependent/Letters.t to test the bug. > >Test plan >========= > >1/ Apply the patch and run prove -v t/db_dependent/Letters.t >2/ Test 38 should FAIL - getletter() fails when message_transport_type > is not passed by caller function i.e. delete_confirm() in letter.pl > > # Failed test 'Bug 14206 - message_transport_type not passed, correct mtt detected' > # at t/db_dependent/Letters.t line 179. > # got: undef > # expected: 'print' > > Test 39 should pass - getletter() functions correctly when passed > message_transport_type param by caller function i.e. add_validate() > >(Test plan continues in the second commit) >--- > t/db_dependent/Letters.t | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index f53e75b..6ac9f58 100644 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -18,7 +18,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 58; >+use Test::More tests => 60; > use Test::MockModule; > use Test::Warn; > >@@ -173,6 +173,12 @@ is( $letter->{title}, $title, 'GetLetters gets the title correctly' ); > is( $letter->{content}, $content, 'GetLetters gets the content correctly' ); > is( $letter->{message_transport_type}, 'email', 'GetLetters gets the message type correctly' ); > >+# Regression test for Bug 14206 >+$dbh->do( q|INSERT INTO letter(branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES ('FFL','my module','my code','my name',1,?,?,'print')|, undef, $title, $content ); >+my $letter14206_a = C4::Letters::getletter('my module', 'my code', 'FFL' ); >+is( $letter14206_a->{message_transport_type}, 'print', 'Bug 14206 - message_transport_type not passed, correct mtt detected' ); >+my $letter14206_b = C4::Letters::getletter('my module', 'my code', 'FFL', 'print'); >+is( $letter14206_b->{message_transport_type}, 'print', 'Bug 14206 - message_transport_type passed, correct mtt detected' ); > > # addalert > my $type = 'my type'; >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14206
:
39270
|
39272
|
39283
|
39315
|
39316
|
39321
|
39342
|
39353
|
39354
|
39376
|
39380
|
39467
|
39512
|
39522
|
39523