summaryrefslogtreecommitdiff
path: root/rt/t/web/current_user_outdated_email.t
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-09-15 20:44:48 -0700
committerIvan Kohler <ivan@freeside.biz>2014-09-15 20:44:48 -0700
commited1f84b4e8f626245995ecda5afcf83092c153b2 (patch)
tree3f58bbef5fbf2502e65d29b37b5dbe537519e89d /rt/t/web/current_user_outdated_email.t
parentfe9ea9183e8a16616d6d04a7b5c7498d28e78248 (diff)
RT 4.0.22
Diffstat (limited to 'rt/t/web/current_user_outdated_email.t')
-rw-r--r--rt/t/web/current_user_outdated_email.t41
1 files changed, 41 insertions, 0 deletions
diff --git a/rt/t/web/current_user_outdated_email.t b/rt/t/web/current_user_outdated_email.t
new file mode 100644
index 000000000..51fc803c6
--- /dev/null
+++ b/rt/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@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" );
+}
+