use throw() for message page
[sgn.git] / t / system_message.t
blobd0880a1fde0aff6afc0f521f64ff598e3f0a809a
1 use Test::Most tests => 2;
2 use File::Temp;
4 use SGN::Context;
5 use CXGN::MasonFactory;
7 my $c = SGN::Context->new;
9 my $tempfile = File::Temp->new;
10 $tempfile->print("fogbat!");
11 $tempfile->close;
13 $c->config->{system_message_file} = undef;
14 is( CXGN::MasonFactory->bare_render('/system_message.mas' ),
15     '',
16     'system message is empty for no message file'
17    );
19 # correctly set system_message_file var
20 $c->config->{system_message_file} = "$tempfile";
21 like( CXGN::MasonFactory->bare_render('/system_message.mas'),
22       qr/fogbat/,
23       'system message looks correct'
24      );