From: Chris W. <la...@us...> - 2004-11-25 03:51:54
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12917/t Modified Files: url.t Log Message: add strip_deployment_context() method to OI2::URL, plus tests Index: url.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/url.t,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** url.t 24 Nov 2004 14:16:01 -0000 1.12 --- url.t 25 Nov 2004 03:51:43 -0000 1.13 *************** *** 7,11 **** require 'utils.pl'; use OpenInteract2::Context qw( CTX ); ! use Test::More tests => 104; initialize_context(); --- 7,11 ---- require 'utils.pl'; use OpenInteract2::Context qw( CTX ); ! use Test::More tests => 109; initialize_context(); *************** *** 325,329 **** --- 325,352 ---- { + my $url = '/OpenInteract/foo/bar'; + my $strip_url = $UCL->strip_deployment_context( $url ); + is( $strip_url, '/foo/bar', + 'Strip context from URL with additional info' ); + $url = '/OpenInteract/'; + $strip_url = $UCL->strip_deployment_context( $url ); + is( $strip_url, '/', + 'Strip context from URL with slash but no additional info' ); + $url = '/OpenInteract'; + $strip_url = $UCL->strip_deployment_context( $url ); + is( $strip_url, '', + 'Strip context from URL with no slash and no additional info' ); + $url = '/OpenInteract2'; + $strip_url = $UCL->strip_deployment_context( $url ); + is( $strip_url, '/OpenInteract2', + 'Do not strip context from URL with more info than deployment context, no slash' ); + $url = '/OpenInteract2/'; + $strip_url = $UCL->strip_deployment_context( $url ); + is( $strip_url, '/OpenInteract2/', + 'Do not strip context from URL with more info than deployment context, slash' ); + } + + { CTX->assign_deploy_url( '' ); my %params = ( id => 55, undercover => 'yes' ); *************** *** 343,346 **** --- 366,370 ---- } + # TODO: Once we get the test website/actions setup, create tests for # parse_action() (we don't need as many -- just ones to test a known |