Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test static files
  • Loading branch information
kraih committed Jan 24, 2013
1 parent 99621b4 commit 66a04af
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

3.83 2013-01-25
- Moved bundled static files to mojo directory.
- Improved documentation.
- Improved tests.

Expand Down
3 changes: 1 addition & 2 deletions lib/Mojo.pm
Expand Up @@ -26,9 +26,8 @@ has ua => sub {
sub new {
my $self = shift->SUPER::new(@_);

my $home = $self->home->detect(ref $self);

# Check if we have a log directory
my $home = $self->home->detect(ref $self);
$self->log->path($home->rel_file('log/mojo.log'))
if -w $home->rel_file('log');

Expand Down
18 changes: 18 additions & 0 deletions t/mojolicious/exception_lite_app.t
Expand Up @@ -187,6 +187,24 @@ $t->get_ok('/reuse/exception')->status_is(500)
isa_ok $exception, 'Mojo::Exception', 'right exception class';
like $exception, qr/Reusable exception/, 'right exception';

# Bundled static files
$t->get_ok('/mojo/jquery/jquery.js')->status_is(200)
->content_type_is('application/javascript');
$t->get_ok('/mojo/prettify/prettify.js')->status_is(200)
->content_type_is('application/javascript');
$t->get_ok('/mojo/prettify/prettify-mojo.css')->status_is(200)
->content_type_is('text/css');
$t->get_ok('/mojo/failraptor.png')->status_is(200)
->content_type_is('image/png');
$t->get_ok('/mojo/logo-black.png')->status_is(200)
->content_type_is('image/png');
$t->get_ok('/mojo/logo-white.png')->status_is(200)
->content_type_is('image/png');
$t->get_ok('/mojo/noraptor.png')->status_is(200)->content_type_is('image/png');
$t->get_ok('/mojo/notfound.png')->status_is(200)->content_type_is('image/png');
$t->get_ok('/mojo/pinstripe.gif')->status_is(200)
->content_type_is('image/gif');

done_testing();

__DATA__
Expand Down

0 comments on commit 66a04af

Please sign in to comment.