Bug 8612: [QA Follow-up] Remove two newlines from template output
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 2 Jun 2017 06:08:57 +0000 (08:08 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Jun 2017 15:02:08 +0000 (12:02 -0300)
When using the Default profile from the basket form, the resulting csv
file has an additional newline after the headers and at the end.
This patch removes them.
Unit test adjusted accordingly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt
t/db_dependent/Acquisition/GetBasketAsCSV.t

index 0ca6a84..6ee81aa 100644 (file)
@@ -1,3 +1,4 @@
 [% INCLUDE csv_headers/acqui/basket.tt %]
-[% FOREACH r IN rows %]"[% r.contractname %]",[% r.ordernumber %],[% r.entrydate %],[% r.isbn %],"[% r.author %]","[% r.title %]",[% r.publicationyear %],"[% r.publishercode %]","[% r.collectiontitle %]","[% r.notes %]",[% r.quantity %],[% r.rrp %],"[% r.deliveryplace %]","[% r.billingplace %]"
-[% END %]
+[%- FOREACH r IN rows -%]
+"[% r.contractname %]",[% r.ordernumber %],[% r.entrydate %],[% r.isbn %],"[% r.author %]","[% r.title %]",[% r.publicationyear %],"[% r.publishercode %]","[% r.collectiontitle %]","[% r.notes %]",[% r.quantity %],[% r.rrp %],"[% r.deliveryplace %]","[% r.billingplace %]"
+[% END -%]
index b6dfdbe..33e6f16 100644 (file)
@@ -72,9 +72,7 @@ is($basket_csv1, 'autor,title,quantity
 # Use default template
 my $basket_csv2 = C4::Acquisition::GetBasketAsCSV($basketno, $query);
 is($basket_csv2, 'Contract name,Order number,Entry date,ISBN,Author,Title,Publication year,Publisher,Collection title,Note for vendor,Quantity,RRP,Delivery place,Billing place
-
 "",' . $order->{ordernumber}  . ',2016-01-02,,"King, Stephen","Test Record",,"","","",3,,"",""
-
 ', 'CSV should be generated with default template');
 
 my $basket_csv3 = C4::Acquisition::GetBasketAsCSV($basketno, $query, $csv_profile2->export_format_id);