[Rt-commit] r10051 - in rt/branches/3.999-DANGEROUS: lib/RT t/web

jesse at bestpractical.com jesse at bestpractical.com
Mon Dec 24 00:27:32 EST 2007


Author: jesse
Date: Mon Dec 24 00:27:32 2007
New Revision: 10051

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm
   rt/branches/3.999-DANGEROUS/t/web/basic.t

Log:
 r74080 at pinglin:  jesse | 2007-12-23 14:02:01 -0500
 * login tests now work. (except for a minutes-hours conversion)


Modified: rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/SavedSearches.pm	Mon Dec 24 00:27:32 2007
@@ -76,7 +76,7 @@
     my $class = ref($proto) || $proto;
     my $self  = {};
     bless ($self, $class);
-    $self->current_user(@_);
+    $self->_get_current_user();
     $self->{'idx'} = 0;
     $self->{'objects'} = [];
     return $self;
@@ -165,7 +165,6 @@
     my $self        = shift;
     my $CurrentUser = $self->current_user;
 
-    Carp::confess unless ($self->current_user);
     my $groups = RT::Model::GroupCollection->new;
     $groups->LimitToUserDefinedGroups;
     $groups->WithMember( principal_id => $self->current_user->id,

Modified: rt/branches/3.999-DANGEROUS/t/web/basic.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/basic.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/basic.t	Mon Dec 24 00:27:32 2007
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use strict;
-use RT::Test; use Test::More tests => 20;
+use RT::Test; use Test::More tests => 19;
 use HTTP::Request::Common;
 use HTTP::Cookies;
 use LWP;
@@ -22,19 +22,19 @@
 # {{{ test a login
 
 # follow the link marked "Login"
+#
+my $username = 'root at localhost';
+my $password = "password";
 
-ok($agent->{form}->find_input('user'));
-
-ok($agent->{form}->find_input('pass'));
-ok ($agent->{'content'} =~ /username:/i);
-$agent->field( 'user' => 'root' );
-$agent->field( 'pass' => 'password' );
-# the field isn't named, so we have to click link 0
-$agent->click(0);
-is($agent->{'status'}, 200, "Fetched the page ok");
-ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
+            my $moniker = $agent->moniker_for('RT::Action::Login');
 
+ok($moniker, "Found the moniker $moniker");
 
+    ok( $agent->fill_in_action($moniker
+            , email => $username, password => $password), "Filled in the login box");
+$agent->submit();
+is($agent->{'status'}, 200, "Fetched the page ok");
+ok( $agent->content =~ /Logout/i, "Found a logout link");
 $agent->get($url."Ticket/Create.html?Queue=1");
 is ($agent->{'status'}, 200, "Loaded Create.html");
 $agent->form_number(3);


More information about the Rt-commit mailing list