Merge branch 'master' into topic/dt_feature_search
[sgn.git] / t / legacy / integration / solpeople.t
blob7fb88fd0e87487f2421895fd6aa95fa63a8cf9b1
1 =head1 NAME
3 t/integration/solpeople.t - tests for solpeople URLs
5 =head1 DESCRIPTION
7 Tests for solpeople URLs
9 =head1 AUTHORS
11 Jonathan "Duke" Leto
13 =cut
15 use strict;
16 use warnings;
17 use Test::More;
18 use Test::JSON;
19 use lib 't/lib';
20 use SGN::Test;
21 use SGN::Test::WWW::Mechanize;
23 my $base_url = $ENV{SGN_TEST_SERVER};
24 my $mech = SGN::Test::WWW::Mechanize->new;
26 $mech->while_logged_in_all( sub {
27     my ($user_info) = @_;
28     $mech->get_ok('/solpeople/top-level.pl');
29     $mech->content_contains('My '.$mech->context->get_conf("project_name") );
30     $mech->content_contains('[log out]');
31     $mech->content_contains('User Status');
32     $mech->content_contains('General Tools');
33     $mech->content_like(qr{Your current user status is\s+<b>$user_info->{user_type}</b>});
34 });
37     my $url = "/solpeople/account-confirm.pl";
38     $mech->get_ok("$base_url/$url?username=fiddlestix");
39     $mech->content_like(qr/.*Sorry, we are unable to process this confirmation request\..*No confirmation is required for user .*fiddlestix/ms);
43     my $url = "/solpeople/personal-info.pl";
44     $mech->get_ok("$base_url/$url?action=edit&sp_person_id=42");
45     $mech->content_like(qr/You do not have rights to modify this database entry because you do not own it/ms);
49     my $url = "/solpeople/personal-info.pl";
50     $mech->get_ok("$base_url/$url?action=store&sp_person_id=42");
51     $mech->content_like(qr/You do not have rights to modify this database entry because you do not own it/ms);
55     my $url = '/solpeople/login.pl';
56     $mech->get_ok("$base_url/$url?logout=yes");
57     $mech->content_like(qr/You have successfully logged out\. Thanks for using/ms);
60 done_testing;