9 use File::Temp qw(tempdir);
11 use Debbugs::MIME qw(create_mime_message);
12 use File::Basename qw(dirname basename);
13 use Test::WWW::Mechanize;
14 use HTTP::Status qw(RC_NOT_MODIFIED);
15 # The test functions are placed here to make things easier
17 use DebbugsTest qw(:all);
21 my %config = create_debbugs_configuration();
26 send_message(to=>'submit@bugs.something',
27 headers => [To => 'submit@bugs.something',
28 From => 'foo@bugs.something',
29 Subject => 'Submitting a bug '.$_,
32 body => <<EOF) or fail('Unable to send message');
36 This is a silly bug $_
40 send_message(to => 'control@bugs.something',
41 headers => [To => 'control@bugs.something',
42 From => 'foo@bugs.something',
43 Subject => "Munging bugs with blocks",
45 body => <<'EOF') or fail 'message to control@bugs.something failed';
53 ## create the database
54 my $pgsql = create_postgresql_database();
55 update_postgresql_database($pgsql);
64 ok($s = Debbugs::DB->connect($pgsql->dsn),
65 "Able to connect to database");
68 ok($s->resultset('Bug')->search({id => 1})->single->subject eq
75 $s->resultset('Bug')->search({id => 1})->single->
76 bug_blocks_bugs(undef,
77 {columns => [qw(blocks)],
78 result_class=>'DBIx::Class::ResultClass::HashRefInflator',
81 is_deeply([sort @blocking_bugs],
82 [3,4],"Blocking bugs of 1 inserted correctly");
84 done_testing($tests_run);