# -*- mode: cperl;-*-
-# $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $
-use Test::More tests => 2;
+
+use Test::More tests => 3;
use warnings;
use strict;
# The test functions are placed here to make things easier
use lib qw(t/lib);
use DebbugsTest qw(:all);
-use Data::Dumper;
my %config;
eval {
send_message(to=>'submit@bugs.something',
headers => [To => 'submit@bugs.something',
From => 'foo@bugs.something',
- Subject => 'Submiting a bug',
+ Subject => 'Submitting a bug',
],
body => <<EOF) or fail('Unable to send message');
Package: foo
my $bugreport_cgi_handler = sub {
# I do not understand why this is necessary.
$ENV{DEBBUGS_CONFIG_FILE} = "$config{config_dir}/debbugs_config";
- print qx(perl -I. -T cgi/bugreport.cgi);
+ my $content = qx(perl -I. -T cgi/bugreport.cgi);
+ $content =~ s/^\s*Content-Type:[^\n]+\n*//si;
+ print $content;
};
my $port = 11342;
ok(DebbugsTest::HTTPServer::fork_and_create_webserver($bugreport_cgi_handler,$port),
'forked HTTP::Server::Simple successfully');
-
my $mech = Test::WWW::Mechanize->new();
-$mech->get_ok('http://localhost:'.$port.'/?bug=1');
+$mech->get_ok('http://localhost:'.$port.'/?bug=1',
+ 'Page received ok');
+ok($mech->content() =~ qr/\<title\>\#1.+Submitting a bug/i,
+ 'Title of bug is submitting a bug');
+
+# Other tests for bugs in the page should be added here eventually
+