4 use RT::Test nodb => 1, tests => undef;
15 my $meta = RT::Config->Meta('foo');
16 is( $meta->{Section}, 'bar', 'Section is bar' );
17 is( $meta->{Widget}, '/Widgets/Form/String', 'default Widget is string' );
18 is_deeply( $meta->{WidgetArguments},
19 {},, 'default WidgetArguments is empty hashref' );
22 RT::Config->UpdateOption(
25 Widget => '/Widgets/Form/Boolean',
27 'updated option foo to section baz'
29 is( $meta->{Section}, 'baz', 'section is updated to baz' );
30 is( $meta->{Widget}, '/Widgets/Form/Boolean', 'widget is updated to boolean' );
32 ok( RT::Config->DeleteOption( Name => 'foo' ), 'removed option foo' );
33 is( RT::Config->Meta('foo'), undef, 'foo is indeed deleted' );
35 # Test EmailInputEncodings PostLoadCheck code
36 RT::Config->Set('EmailInputEncodings', qw(utf-8 iso-8859-1 us-ascii foo));
37 my @encodings = qw(utf-8-strict iso-8859-1 ascii);
39 warning_is {RT::Config->PostLoadCheck} "Unknown encoding 'foo' in \@EmailInputEncodings option",
40 'Correct warning for encoding foo';
42 RT::Config->Set( WebDefaultStylesheet => 'non-existent-skin-name' );
43 warning_like {RT::Config->PostLoadCheck} qr{rudder},
44 'Correct warning for default stylesheet';
46 my @canonical_encodings = RT::Config->Get('EmailInputEncodings');
47 is_deeply(\@encodings, \@canonical_encodings, 'Got correct encoding list');