X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=t%2F21_database.t;fp=t%2F21_database.t;h=ca416d43d6dcfd288e3bb3d95adbdfe1b896beb8;hb=53c435119200ab9b1c2538a96b8374c51a078855;hp=0000000000000000000000000000000000000000;hpb=0e8f07fda6e40b5967d9c6b28b3200db22766343;p=debbugs.git diff --git a/t/21_database.t b/t/21_database.t new file mode 100644 index 0000000..ca416d4 --- /dev/null +++ b/t/21_database.t @@ -0,0 +1,63 @@ +# -*- mode: cperl;-*- + +use Test::More; + +use warnings; +use strict; + +# Here, we're going to shoot messages through a set of things that can +# happen. + +# First, we're going to send mesages to receive. +# To do so, we'll first send a message to submit, +# then send messages to the newly created bugnumber. + +use IO::File; +use File::Temp qw(tempdir); +use Cwd qw(getcwd); +use Debbugs::MIME qw(create_mime_message); +use File::Basename qw(dirname basename); +use Test::WWW::Mechanize; +use HTTP::Status qw(RC_NOT_MODIFIED); +# The test functions are placed here to make things easier +use lib qw(t/lib); +use DebbugsTest qw(:all); + +our $tests_run = 0; + +my %config = create_debbugs_configuration(); + + +# create a bug +send_message(to=>'submit@bugs.something', + headers => [To => 'submit@bugs.something', + From => 'foo@bugs.something', + Subject => 'Submitting a bug', + ], + body => <connect($pgsql->dsn), + "Able to connect to database"); +$tests_run++; + +ok($s->resultset('Bug')->search({id => 1})->single->subject eq + 'Submitting a bug', + "Correct bug title"); +$tests_run++; + +done_testing($tests_run);