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