summaryrefslogtreecommitdiff
path: root/t/Webmail.t
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2020-10-29 12:13:04 +0100
committerJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2020-10-29 12:13:04 +0100
commitee43823179ee627ac16ea9da8168e5f1bf9619c0 (patch)
tree5e6c36d5629d2ce79f3cb1310998dc715a6f19c7 /t/Webmail.t
Initial commit; Stable version
Diffstat (limited to 't/Webmail.t')
-rw-r--r--t/Webmail.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/Webmail.t b/t/Webmail.t
new file mode 100644
index 0000000..48406b9
--- /dev/null
+++ b/t/Webmail.t
@@ -0,0 +1,34 @@
+use v5.22;
+use warnings;
+use utf8;
+
+use Test::More;
+use Test::Mojo;
+
+use JWebmail::Model::Driver::Mock;
+
+my $user = JWebmail::Model::Driver::Mock::VALID_USER;
+my $pw = JWebmail::Model::Driver::Mock::VALID_PW;
+
+my $t = Test::Mojo->new('JWebmail', {
+ development => { use_read_mock => 1, block_writes => 1 },
+});
+
+$t->get_ok('/')->status_is(200);
+
+$t->post_ok('/login', form => {userid => $user, password => 'x'})
+ ->status_is(400);
+
+$t->post_ok('/login', form => {userid => $user, password => 'abcde'})
+ ->status_is(401);
+
+$t->post_ok('/login', form => {userid => $user, password => $pw})
+ ->status_is(303);
+
+done_testing();
+
+
+#$r->get('/123' => sub { my $c = shift; $c->render(inline => $c->stash->{lang}) });
+#my $x = $self->build_controller;
+#$x->match->find($self, {method => 'GET', path => '//write'});
+#print $self->dumper($x->match->stack); \ No newline at end of file