Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv5228/t
Modified Files:
06-action-wtscript.t 05-action-request.t 04-action-list.t
03-action.t
Log Message:
Updated
Index: 06-action-wtscript.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/06-action-wtscript.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** 06-action-wtscript.t 7 Jan 2003 21:03:55 -0000 1.1
--- 06-action-wtscript.t 18 Jan 2003 18:52:18 -0000 1.2
***************
*** 43,49 ****
}
! # check if template_data returns draft of wtscript
{
! my %data = $ACTION->template_data($CONTROLLER);
is($data{wtscript}, <<'WTSCRIPT',
test_name = N/A
--- 43,49 ----
}
! # check if execute returns draft of wtscript
{
! my %data = $ACTION->execute($CONTROLLER);
is($data{wtscript}, <<'WTSCRIPT',
test_name = N/A
Index: 05-action-request.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/05-action-request.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 05-action-request.t 7 Jan 2003 21:10:04 -0000 1.2
--- 05-action-request.t 18 Jan 2003 18:52:18 -0000 1.3
***************
*** 38,55 ****
}
! # check if template_data returns request object by number
{
$CONTROLLER->cgi(CGI->new({num => 0}));
! my %data = $ACTION->template_data($CONTROLLER);
is($data{test}, $RECORDER->tests->[0],
'Check if "test" variable is defined');
$CONTROLLER->cgi(CGI->new({num => 1}));
! %data = $ACTION->template_data($CONTROLLER);
is($data{test}, $RECORDER->tests->[1],
'Check if "test" variable is defined');
$CONTROLLER->cgi(CGI->new({num => 2}));
! %data = $ACTION->template_data($CONTROLLER);
is($data{test}, undef,
'Check if "test" variable is not defined');
--- 38,55 ----
}
! # check if execute returns request object by number
{
$CONTROLLER->cgi(CGI->new({num => 0}));
! my %data = $ACTION->execute($CONTROLLER);
is($data{test}, $RECORDER->tests->[0],
'Check if "test" variable is defined');
$CONTROLLER->cgi(CGI->new({num => 1}));
! %data = $ACTION->execute($CONTROLLER);
is($data{test}, $RECORDER->tests->[1],
'Check if "test" variable is defined');
$CONTROLLER->cgi(CGI->new({num => 2}));
! %data = $ACTION->execute($CONTROLLER);
is($data{test}, undef,
'Check if "test" variable is not defined');
Index: 04-action-list.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/04-action-list.t,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** 04-action-list.t 3 Jan 2003 23:01:15 -0000 1.1.1.1
--- 04-action-list.t 18 Jan 2003 18:52:18 -0000 1.2
***************
*** 24,28 ****
# test template_data to return recorder object
{
! my %data = $ACTION->template_data($CONTROLLER);
is($data{tests}, $RECORDER->tests,
'Check if "tests" variable is defined');
--- 24,28 ----
# test template_data to return recorder object
{
! my %data = $ACTION->execute($CONTROLLER);
is($data{tests}, $RECORDER->tests,
'Check if "tests" variable is defined');
Index: 03-action.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/03-action.t,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** 03-action.t 3 Jan 2003 23:01:15 -0000 1.1.1.1
--- 03-action.t 18 Jan 2003 18:52:19 -0000 1.2
***************
*** 6,10 ****
use HTTP::Status;
! use Test::More tests => 15;
# get test template files directory included in search path
--- 6,10 ----
use HTTP::Status;
! use Test::More tests => 5;
# get test template files directory included in search path
***************
*** 20,61 ****
isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
! # test template_data()
{
! is_deeply([$ACTION->template_data($CONTROLLER)],
[action => $ACTION, controller => $CONTROLLER],
'Test template_data()');
- }
-
- # try to access recorder's web interface
- {
- $CONTROLLER->view('testdump');
- my $response = $ACTION->execute($CONTROLLER);
- is($response->header('Content-Type'), 'text/html',
- 'Response is in HTML');
- is($response->code, RC_OK, 'Expect success code');
- like($response->content, qr/ACTION = HTTP::WebTest::Action/,
- 'Action object should be passed to template');
- like($response->content, qr/CONTROLLER = HTTP::WebTest::Controller/,
- 'Request object should be passed to template');
- }
-
- # try to access part of recorder's web interface which doesn't exist
- {
- $CONTROLLER->view('testmissing');
- my $response = $ACTION->execute($CONTROLLER);
- is($response->code, RC_NOT_FOUND, 'Expect not found error');
- is($response->header('Content-Type'), 'text/plain',
- 'Response is a plain text');
- is($response->content, 'Not Found', 'Check text of error message');
- }
-
- # try to access faulty part of recorder's web interface
- {
- $CONTROLLER->view('testcrash');
- my $response = $ACTION->execute($CONTROLLER);
- is($response->code, RC_INTERNAL_SERVER_ERROR, 'Expect internal error');
- is($response->header('Content-Type'), 'text/plain',
- 'Response is a plain text');
- like($response->content, qr/parse error.*unexpected token \(ME\)/,
- 'Verify text of error message');
}
--- 20,27 ----
isa_ok($CONTROLLER, 'HTTP::WebTest::Controller');
! # test execute()
{
! is_deeply([$ACTION->execute($CONTROLLER)],
[action => $ACTION, controller => $CONTROLLER],
'Test template_data()');
}
|