]> git.donarmstrong.com Git - debbugs.git/blobdiff - t/07_bugreport.t
Fix default user for usertags
[debbugs.git] / t / 07_bugreport.t
index c1438c276888711bb4cab8eec14f00131bf25a50..2ece25b3e3ae5a5e5630c40da1b67ad9967d4dff 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 
 
-use Test::More tests => 18;
+use Test::More tests => 22;
 
 use warnings;
 use strict;
@@ -24,13 +24,8 @@ use HTTP::Status qw(RC_NOT_MODIFIED);
 use lib qw(t/lib);
 use DebbugsTest qw(:all);
 
-my %config;
-eval {
-     %config = create_debbugs_configuration();
-};
-if ($@) {
-     BAIL_OUT($@);
-}
+my %config = create_debbugs_configuration();
+
 
 # create a bug
 send_message(to=>'submit@bugs.something',
@@ -42,7 +37,9 @@ send_message(to=>'submit@bugs.something',
 Package: foo
 Severity: normal
 
-This is a silly bug
+This is a silly bug which contains an unescaped From line.
+
+From line
 EOF
 
 
@@ -96,6 +93,8 @@ ok($mech->content() =~ qr/Subject: Submitting a bug/i,
    'Subject of bug maibox is right');
 ok($mech->content() =~ qr/^From /m,
    'Starts with a From appropriately');
+ok($mech->content() =~ qr/^(>F|=46)rom line/m,
+   'From line escaped appropriately');
 
 $mech->get_ok('http://localhost:'.$port.'/?bug=1;mboxmaint=yes',
               'Page received ok');
@@ -151,4 +150,24 @@ EOF
 }
 
 # Other tests for bugs in the page should be added here eventually
+send_message(to => '1@bugs.something',
+              headers => [To   => '1@bugs.something',
+                          From => 'foo@bugs.something',
+                          Subject => "Message with some links to linkify",
+                         ],
+              body => <<EOF) or fail 'message to 1@bugs.something failed';
+This is a test message.
+
+This is a link https://example.com/foo; which should not include the ;
+
+
+This is a link https://example.com/foo;bar which should include the ;
+EOF
+
+$mech->get_ok('http://localhost:'.$port.'/?bug=1',
+               'Page received ok');
+like($mech->content(), qr(href="https://example.com/foo;bar"),
+     'Link includes ; correctly');
 
+like($mech->content(), qr(href="https://example.com/foo"),
+     'Link excludes trailing ;');