Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git] / rt / t / web / user_update.t
1 use strict;
2 use warnings;
3 use utf8;
4 use RT::Test tests => undef;
5
6 my ( $url, $m ) = RT::Test->started_ok;
7 ok( $m->login(), 'logged in' );
8
9 $m->follow_link_ok({text => 'About me'});
10 $m->submit_form_ok({ with_fields => { Lang => 'ja'} },
11                "Change to Japanese");
12 $m->text_contains("Lang changed from (no value) to 'ja'");
13 $m->text_contains("実名", "Page content is japanese");
14
15 # we only changed one field, and it wasn't the default, so this feedback is
16 # spurious and annoying
17 $m->content_lacks("That is already the current value");
18
19 # change back to English
20 $m->submit_form_ok({ with_fields => { Lang => 'en_us'} },
21                "Change back to english");
22
23 # This message shows up in Japanese
24 # $m->text_contains("Lang changed from 'ja' to 'en_us'");
25 $m->text_contains("Langは「'ja'」から「'en_us'」に変更されました");
26 $m->text_contains("Real Name", "Page content is english");
27
28 # Check for a lack of spurious updates
29 $m->content_lacks("That is already the current value");
30
31 # Ensure that we can change the language back to the default.
32 $m->submit_form_ok({ with_fields => { Lang => 'ja'} },
33                    "Back briefly to Japanese");
34 $m->text_contains("Lang changed from 'en_us' to 'ja'");
35 $m->text_contains("実名", "Page content is japanese");
36 $m->submit_form_ok({ with_fields => { Lang => ''} },
37                    "And set to the default");
38 $m->text_contains("Langは「'ja'」から「(値なし)」に変更されました");
39 $m->text_contains("Real Name", "Page content is english");
40
41 undef $m;
42
43 done_testing;