File: current_user_outdated_email.t

package info (click to toggle)
request-tracker5 5.0.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80,216 kB
  • sloc: javascript: 191,898; perl: 87,146; sh: 1,412; makefile: 487; python: 37; php: 15
file content (41 lines) | stat: -rw-r--r-- 1,186 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

use strict;
use warnings;
use RT::Test tests => 39;

my ( $url, $m ) = RT::Test->started_ok;

$m->login();

my @links = (
    '/',                                '/Ticket/Create.html?Queue=1',
    '/SelfService/Create.html?Queue=1', '/m/ticket/create?Queue=1'
);

my $root = RT::Test->load_or_create_user( Name => 'root' );
ok( $root->id, 'loaded root' );
is( $root->EmailAddress, 'root@localhost', 'default root email' );

for my $link (@links) {
    $m->get_ok($link);
    $m->content_contains( '"root@localhost"', "default email in $link" );
}

$root->SetEmailAddress('foo@example.com');
is( $root->EmailAddress, 'foo@example.com', 'changed to foo@example.com' );

for my $link (@links) {
    $m->get_ok($link);
    $m->content_lacks( '"root@localhost"', "no default email in $link" );
    $m->content_contains( '"foo@example.com"', "new email in $link" );
}

$root->SetEmailAddress('root@localhost');
is( $root->EmailAddress, 'root@localhost', 'changed back to root@localhost' );

for my $link (@links) {
    $m->get_ok($link);
    $m->content_lacks( '"foo@example.com"', "no previous email in $link" );
    $m->content_contains( '"root@localhost"', "default email in $link" );
}