From 1ece1a1d507da7a0025fcb14212adda4a3a2365a Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 28 Feb 2018 14:28:53 -0800 Subject: [PATCH] add start of database seting --- t/21_database.t | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 t/21_database.t 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); -- 2.39.2