Allow having no captcha, add registration test
[scpubgit/stemmaweb.git] / t / 05register.t
CommitLineData
32d1fbf8 1use warnings;
2use strict;
3
4use stemmaweb;
5use LWP::Protocol::PSGI;
6use Test::WWW::Mechanize;
7
8use Test::More;
9use HTML::TreeBuilder;
10use Data::Dumper;
11
12use FindBin;
13use lib ("$FindBin::Bin/lib");
14
15use stemmaweb::Test::DB;
16
17stemmaweb::Test::DB->new_db;
18
19LWP::Protocol::PSGI->register(stemmaweb->psgi_app);
20
21use stemmaweb::Test::Common;
22
23my $ua = Test::WWW::Mechanize->new;
24
25$ua->get_ok('http://localhost/register');
26
27my $response = $ua->submit_form(
28 fields => {
29 username => 'user2@example.org',
30 password => 'UserPass',
31 confirm_password => 'UserPass',
32 });
33
34warn $ua->content;
35
36=cut
37
38$ua->content_contains('Stemmaweb - Logged in', 'Log in successful.');
39
40my $content = $ua->get('/');
41$ua->content_contains('Hello! user@example.org', 'We are logged in.');
42
43=cut
44
45done_testing;