Skip to content

Commit

Permalink
better config plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 5, 2012
1 parent 0baacda commit 600aaac
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions t/mojolicious/embedded_app.t
Expand Up @@ -32,48 +32,48 @@ my $t = Test::Mojo->new;
$t->get_ok('/hello')->status_is(200)->content_is("Hello from the main app!\n");

# GET /x/1 (external app)
$t->get_ok('/x/1')->status_is(200)->content_is('too!');
$t->get_ok('/x/1')->status_is(200)->content_is('too%21');

# GET /x/1/index.html (external app)
$t->get_ok('/x/1/index.html')->status_is(200)
->content_is("External static file!\n");

# GET /x/1/test (external app)
$t->get_ok('/x/1/test')->status_is(200)->content_is('works!');
$t->get_ok('/x/1/test')->status_is(200)->content_is('works%21');

# GET /x/♥ (external app)
$t->get_ok('/x/♥')->status_is(200)->content_is('too!');
$t->get_ok('/x/♥')->status_is(200)->content_is('too%21');

# GET /x/♥/index.html (external app)
$t->get_ok('/x/♥/index.html')->status_is(200)
->content_is("External static file!\n");

# GET /x/♥/test (external app)
$t->get_ok('/x/♥/test')->status_is(200)->content_is('works!');
$t->get_ok('/x/♥/test')->status_is(200)->content_is('works%21');

# GET / (external app with domain)
$t->get_ok('/' => {Host => 'mojolicio.us'})->status_is(200)
->content_is('too!');
->content_is('too%21');

# GET /index.html (external app with domain)
$t->get_ok('/index.html' => {Host => 'mojolicio.us'})->status_is(200)
->content_is("External static file!\n");

# GET /test (external app with domain)
$t->get_ok('/test' => {Host => 'mojolicio.us'})->status_is(200)
->content_is('works!');
->content_is('works%21');

# GET /♥/123/ (external app with a bit of everything)
$t->get_ok('/♥/123/' => {Host => 'test.foo-bar.de'})->status_is(200)
->content_is('too!');
->content_is('too%21');

# GET /♥/123/index.html (external app with a bit of everything)
$t->get_ok('/♥/123/index.html' => {Host => 'test.foo-bar.de'})
->status_is(200)->content_is("External static file!\n");

# GET /♥/123/test (external app with a bit of everything)
$t->get_ok('/♥/123/test' => {Host => 'test.foo-bar.de'})->status_is(200)
->content_is('works!');
->content_is('works%21');

__DATA__
Expand Down
3 changes: 2 additions & 1 deletion t/mojolicious/external/my_app.conf
@@ -1 +1,2 @@
{works => 'too!'}
use Mojo::Util 'url_escape';
{works => url_escape 'too!'}
3 changes: 2 additions & 1 deletion t/mojolicious/external/my_app.testing.conf
@@ -1 +1,2 @@
{whatever => 'works!'};
use Mojo::Util 'url_escape';
{whatever => url_escape 'works!'};
4 changes: 2 additions & 2 deletions t/mojolicious/external_app.t
Expand Up @@ -21,11 +21,11 @@ use Test::Mojo;
my $t = Test::Mojo->new('MyApp');

# GET /
$t->get_ok('/')->status_is(200)->content_is('too!');
$t->get_ok('/')->status_is(200)->content_is('too%21');

# GET /index.html
$t->get_ok('/index.html')->status_is(200)
->content_is("External static file!\n");

# GET /test
$t->get_ok('/test')->status_is(200)->content_is('works!');
$t->get_ok('/test')->status_is(200)->content_is('works%21');

0 comments on commit 600aaac

Please sign in to comment.