blob: f61c931a0bc2739b58f20c1ac562da0a919cc25b (
plain)
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
|
use strict;
use warnings;
use RT::Test tests => 12;
my $user = RT::User->new(RT->SystemUser);
ok(
$user->Create(
Name => 'foo',
Privileged => 1,
Password => 'foobar'
)
);
my ( $url, $m ) = RT::Test->started_ok;
ok( $m->login, 'root logged in' );
$m->get_ok( $url . '/Search/Build.html?Query=id<100' );
$m->submit_form(
form_name => 'BuildQuery',
fields => { SavedSearchDescription => 'test' },
button => 'SavedSearchSave',
);
$m->content_contains( q{name="SavedSearchDescription" value="test"},
'saved test search' );
my ($id) = $m->content =~ /value="(RT::User-\d+-SavedSearch-\d+)"/;
ok( $m->login( 'foo', 'foobar', logout => 1 ), 'logged in' );
$m->get_ok( $url . "/Search/Build.html?SavedSearchLoad=$id" );
my $message = qq{Can not load saved search "$id"};
RT::Interface::Web::EscapeUTF8( \$message );
$m->content_contains( $message, 'user foo can not load saved search of root' );
$m->warning_like( qr/User #\d+ tried to load container user #\d+/,
'get warning' );
|