X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fweb%2Frights1.t;h=c8892f2fef86f4f3e82507248512a41e9ecb89ff;hb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;hp=6da204cc954b26514772d18dbac8e2d6cfcf4bc1;hpb=b4b0c7e72d7eaee2fbfc7022022c9698323203dd;p=freeside.git diff --git a/rt/t/web/rights1.t b/rt/t/web/rights1.t index 6da204cc9..c8892f2fe 100644 --- a/rt/t/web/rights1.t +++ b/rt/t/web/rights1.t @@ -2,7 +2,7 @@ use strict; use HTTP::Cookies; -use RT::Test tests => 35; +use RT::Test tests => 29; my ($baseurl, $agent) = RT::Test->started_ok; # Create a user with basically no rights, to start. @@ -26,7 +26,7 @@ $agent->cookie_jar($cookie_jar); no warnings 'once'; # get the top page -login($agent, $user_obj); +$agent->login( $user_obj->Name, 'customer'); # Test for absence of Configure and Preferences tabs. ok(!$agent->find_link( url => "$RT::WebPath/Admin/", @@ -107,28 +107,4 @@ ok($agent->form_name('BuildQuery'), "Yep, form is still there"); my $input = $agent->current_form->find_input('ValueOfActor'); ok(grep(/customer-$$/, $input->value_names()), "Found self in the actor listing"); -sub login { - my $agent = shift; - - my $url = "http://localhost:" . RT->Config->Get('WebPort') . RT->Config->Get('WebPath') . "/"; - $agent->get($url); - is( $agent->{'status'}, 200, - "Loaded a page - http://localhost" . RT->Config->Get('WebPath') ); - - # {{{ test a login - - # follow the link marked "Login" - - ok( $agent->{form}->find_input('user') ); - - ok( $agent->{form}->find_input('pass') ); - like( $agent->{'content'} , qr/username:/i ); - $agent->field( 'user' => $user_obj->Name ); - $agent->field( 'pass' => 'customer' ); - - # the field isn't named, so we have to click link 0 - $agent->click(0); - is( $agent->{'status'}, 200, "Fetched the page ok" ); - like( $agent->{'content'} , qr/Logout/i, "Found a logout link" ); -} 1;