diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-04-24 11:35:56 -0700 |
commit | 6587f6ba7d047ddc1686c080090afe7d53365bd4 (patch) | |
tree | ec77342668e8865aca669c9b4736e84e3077b523 /rt/t/i18n | |
parent | 47153aae5c2fc00316654e7277fccd45f72ff611 (diff) |
first pass RT4 merge, RT#13852
Diffstat (limited to 'rt/t/i18n')
-rw-r--r-- | rt/t/i18n/caching.t | 33 | ||||
-rw-r--r-- | rt/t/i18n/footer.t | 29 |
2 files changed, 62 insertions, 0 deletions
diff --git a/rt/t/i18n/caching.t b/rt/t/i18n/caching.t new file mode 100644 index 000000000..ebb29423f --- /dev/null +++ b/rt/t/i18n/caching.t @@ -0,0 +1,33 @@ +#!/usr/bin/perl -w +use strict; +use warnings; + +use RT::Test; + +{ + my $french = RT::User->new(RT->SystemUser); + $french->LoadOrCreateByEmail('french@example.com'); + $french->SetName('french'); + $french->SetLang('fr'); + $french->SetPrivileged(1); + $french->SetPassword('password'); + $french->PrincipalObj->GrantRight(Right => 'SuperUser'); +} + + +my ($baseurl, $m) = RT::Test->started_ok; +$m->login( root => "password" ); +$m->get_ok('/Prefs/Other.html'); +$m->content_lacks('Ne pas','Lacks translated french'); +$m->get_ok( "/NoAuth/Logout.html" ); + +$m->login( french => "password" ); +$m->get_ok('/Prefs/Other.html'); +$m->content_contains('Ne pas','Has translated french'); +$m->get_ok( "/NoAuth/Logout.html" ); # ->logout fails because it's translated + +$m->login( root => "password" ); +$m->get_ok('/Prefs/Other.html'); +$m->content_lacks('Ne pas','Lacks translated french'); + +undef $m; diff --git a/rt/t/i18n/footer.t b/rt/t/i18n/footer.t new file mode 100644 index 000000000..e0d09058c --- /dev/null +++ b/rt/t/i18n/footer.t @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w +use strict; +use warnings; + +use RT::Test; + +{ + my $chinese = RT::User->new(RT->SystemUser); + $chinese->LoadOrCreateByEmail('chinese@example.com'); + $chinese->SetName('chinese'); + $chinese->SetLang('zh_tw'); + $chinese->SetPrivileged(1); + $chinese->SetPassword('password'); + $chinese->PrincipalObj->GrantRight(Right => 'SuperUser'); +} + +my ($baseurl, $m) = RT::Test->started_ok; +$m->login( root => "password" ); +$m->content_contains('Copyright','Has english coypright'); +$m->get_ok( "/NoAuth/Logout.html" ); + +$m->login( chinese => "password" ); +$m->content_lacks('Copyright','Lacks english copyright'); +$m->get_ok( "/NoAuth/Logout.html" ); # ->logout fails because it's translated + +$m->login( root => "password" ); +$m->content_contains('Copyright','Still has english copyright'); + +undef $m; |