[Rt-commit] rt branch, 4.0/current-user-outdated-email-name-fix, updated. rt-4.0.1rc1-6-gaa2d329

? sunnavy sunnavy at bestpractical.com
Tue May 24 04:07:18 EDT 2011


The branch, 4.0/current-user-outdated-email-name-fix has been updated
       via  aa2d329d5e95737a70b789c531bc4019a65050a8 (commit)
      from  a882b3d4a5453d1d83a977f74a7ad3fe83acc9dd (commit)

Summary of changes:
 t/web/current_user_outdated_email.t |   41 +++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100644 t/web/current_user_outdated_email.t

- Log -----------------------------------------------------------------
commit aa2d329d5e95737a70b789c531bc4019a65050a8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 24 16:06:02 2011 +0800

    test for updated email of current user

diff --git a/t/web/current_user_outdated_email.t b/t/web/current_user_outdated_email.t
new file mode 100644
index 0000000..51fc803
--- /dev/null
+++ b/t/web/current_user_outdated_email.t
@@ -0,0 +1,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 at localhost', 'default root email' );
+
+for my $link (@links) {
+    $m->get_ok($link);
+    $m->content_contains( '"root at localhost"', "default email in $link" );
+}
+
+$root->SetEmailAddress('foo at example.com');
+is( $root->EmailAddress, 'foo at example.com', 'changed to foo at example.com' );
+
+for my $link (@links) {
+    $m->get_ok($link);
+    $m->content_lacks( '"root at localhost"', "no default email in $link" );
+    $m->content_contains( '"foo at example.com"', "new email in $link" );
+}
+
+$root->SetEmailAddress('root at localhost');
+is( $root->EmailAddress, 'root at localhost', 'changed back to root at localhost' );
+
+for my $link (@links) {
+    $m->get_ok($link);
+    $m->content_lacks( '"foo at example.com"', "no previous email in $link" );
+    $m->content_contains( '"root at localhost"', "default email in $link" );
+}
+

-----------------------------------------------------------------------


More information about the Rt-commit mailing list