changed type validation error to 404
Robert 'phaylon' Sedlacek [Fri, 7 Aug 2009 21:49:29 +0000 (23:49 +0200)]
examples/MyApp-Web/t/02functionality.t
lib/CatalystX/Declare/Action/CatchValidationError.pm
t/051_modifier_signatures.t
t/060_exception_handling.t
t/100_complex.t

index fac9806..0ccdf0e 100644 (file)
@@ -15,13 +15,13 @@ is get('/calc/add/3/4/5'), 12, 'addition';
 is get('/calc/multiply/2/3/4'), 24, 'multiplication';
 
 is get('/calc/unknownthingy/3/4/5'), 'unknown operator', 'unknown operator';
-is get('/calc/add/3/f/5'), 'Bad Request', 'bad request';
+is get('/calc/add/3/f/5'), 'Not found', 'bad request';
 
 like get('/foo/hello'), qr/root controller role/, 'root controller role';
 
 is get('/foo/2/3/add'), 5, 'add two';
 is get('/foo/2/3/multiply'), 6, 'multiply two';
 
-is get('/foo/2/f/add'), 'Bad Request', 'bad request capture args';
+is get('/foo/2/f/add'), 'Not found', 'bad request capture args';
 
 done_testing;
index f7e1f62..585b793 100644 (file)
@@ -20,8 +20,8 @@ role CatalystX::Declare::Action::CatchValidationError {
                 $ctx->error("BAD REQUEST: $error");
             }
             else {
-                $ctx->response->body( 'Bad Request' );
-                $ctx->response->status( 400 );
+                $ctx->response->body( 'Not found' );
+                $ctx->response->status( 404 );
             }
             
             $ctx->detach;
index 531a502..6138f42 100644 (file)
@@ -11,7 +11,7 @@ use Catalyst::Test 'TestApp';
 is get('/modsig/foo/2/3'),      'modifiersignatures/foo modified', 'intended arguments work';
 is get('/modsig/foo/2'),        'Page Not Found', 'missing argument leads to 404';
 is get('/modsig/foo/2/3/4'),    'Page Not Found', 'one argument too many leads to 404';
-is get('/modsig/foo/a/b'),      'Bad Request', 'invalid arguments lead to bad request';
+is get('/modsig/foo/a/b'),      'Not found', 'invalid arguments lead to bad request';
 
 
 done_testing;
index d910ea9..e0450bb 100644 (file)
@@ -18,9 +18,9 @@ my $modget = sub { get(join '/', '/sub_errors/signature_error_on_foo_modify', @_
 
 local *TestApp::debug = sub { 0 };
 
-is $get->('foo'),       'Bad Request', 'detected action signature error';
-is $subget->('foo'),    'Bad Request', 'detected action signature error (child)';
-is $modget->('foo'),    'Bad Request', 'detected action signature error (modified)';
+is $get->('foo'),       'Not found', 'detected action signature error';
+is $subget->('foo'),    'Not found', 'detected action signature error (child)';
+is $modget->('foo'),    'Not found', 'detected action signature error (modified)';
 
 stderr_like {
 
index 91fb45f..93df766 100644 (file)
@@ -62,7 +62,7 @@ is get('/foo/surrounded_target'), 'foo/surrounded_target surrounded', 'action wa
 is get('/foo/inline_class'), 'HELLO', 'inline classes work as expected';
 
 # error handling
-is get('/foo/wants_integer/butdoesntgetone'), 'Bad Request', 'validation error causes bad request error';
+is get('/foo/wants_integer/butdoesntgetone'), 'Not found', 'validation error causes bad request error';
 
 # fix bug with capture args below under { }
 is get('/foo/lower/down/the/param/3/road/5'), 8, 'capture args and block under work together';