[Http-webtest-commits] HTTP-WebTest-Recorder/t 03-actions.t,1.7,1.8
Brought to you by:
m_ilya,
richardanderson
|
From: Ilya M. <m_...@us...> - 2003-04-22 22:07:39
|
Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/t
In directory sc8-pr-cvs1:/tmp/cvs-serv7353/t
Modified Files:
03-actions.t
Log Message:
Move some contoller fields into its temporary heap
Index: 03-actions.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/t/03-actions.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** 03-actions.t 22 Apr 2003 21:44:26 -0000 1.7
--- 03-actions.t 22 Apr 2003 22:07:35 -0000 1.8
***************
*** 6,10 ****
use HTTP::Status;
! use Test::More tests => 46;
# get test template files directory included in search path
--- 6,10 ----
use HTTP::Status;
! use Test::More tests => 48;
# get test template files directory included in search path
***************
*** 65,88 ****
# test request_action()
{
- $CONTROLLER->cgi(CGI->new({num => 0}));
$CONTROLLER->heap({});
request_action($CONTROLLER);
! is_deeply($CONTROLLER->heap,
! { test => $RECORDER->tests->[0],
! num => 0 },
! 'Test if test and test num are returned');
! $CONTROLLER->cgi(CGI->new({num => 1}));
! $CONTROLLER->heap({});
request_action($CONTROLLER);
! is_deeply($CONTROLLER->heap,
! { test => $RECORDER->tests->[1],
! num => 1 },
! 'Test if test and test num are returned');
! $CONTROLLER->cgi(CGI->new({num => 2}));
request_action($CONTROLLER);
! is($CONTROLLER->heap->{tests}, undef,
! 'Check if "test" variable is not defined');
}
--- 65,87 ----
# test request_action()
{
$CONTROLLER->heap({});
+ $CONTROLLER->heap->{cgi} = CGI->new({num => 0});
request_action($CONTROLLER);
! is($CONTROLLER->heap->{test}, $RECORDER->tests->[0],
! 'Test if test object is returned');
! is($CONTROLLER->heap->{num}, 0,
! 'Test if test number is returned');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 1});
request_action($CONTROLLER);
! is($CONTROLLER->heap->{test}, $RECORDER->tests->[1],
! 'Test if test object is returned');
! is($CONTROLLER->heap->{num}, 1,
! 'Test if test number is returned');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 2});
request_action($CONTROLLER);
! is($CONTROLLER->heap->{test}, undef,
! 'Test if test object is not defined');
}
***************
*** 145,149 ****
# test with enable_action() if we can turn on recording
{
! $CONTROLLER->cgi(CGI->new({ enable => 1 }));
$CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
enable_action($CONTROLLER);
--- 144,148 ----
# test with enable_action() if we can turn on recording
{
! $CONTROLLER->heap->{cgi} = CGI->new({ enable => 1 });
$CONTROLLER->heap->{response} = HTTP::Response->new(RC_OK);
enable_action($CONTROLLER);
***************
*** 155,159 ****
# test with enable_action() if we can turn off recording
{
! $CONTROLLER->cgi(CGI->new({ enable => 0 }));
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 154,158 ----
# test with enable_action() if we can turn off recording
{
! $CONTROLLER->heap->{cgi} = CGI->new({ enable => 0 });
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 164,168 ****
# test with enable_action() if we can turn on recording once again
{
! $CONTROLLER->cgi(CGI->new({ enable => 1 }));
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 163,167 ----
# test with enable_action() if we can turn on recording once again
{
! $CONTROLLER->heap->{cgi} = CGI->new({ enable => 1 });
enable_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 173,177 ****
# test response_content_action()
{
! $CONTROLLER->cgi(CGI->new({num => 0, view => 'raw'}));
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
--- 172,176 ----
# test response_content_action()
{
! $CONTROLLER->heap->{cgi} = CGI->new({num => 0, view => 'raw'});
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
***************
*** 181,185 ****
'Test content-type if header is set correctly');
! $CONTROLLER->cgi(CGI->new({num => 2, view => 'raw'}));
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
--- 180,184 ----
'Test content-type if header is set correctly');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 2, view => 'raw'});
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{response}->content,
***************
*** 189,193 ****
'Test content-type if header is set correctly');
! $CONTROLLER->cgi(CGI->new({num => 0, view => 'text'}));
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{content}, $RECORDER->tests->[0]->response->content,
--- 188,192 ----
'Test content-type if header is set correctly');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 0, view => 'text'});
response_content_action($CONTROLLER);
is($CONTROLLER->heap->{content}, $RECORDER->tests->[0]->response->content,
***************
*** 197,201 ****
# test delete_action()
{
! $CONTROLLER->cgi(CGI->new({num => 2}));
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 196,200 ----
# test delete_action()
{
! $CONTROLLER->heap->{cgi} = CGI->new({num => 2});
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 203,207 ****
is(@{$RECORDER->tests}, 2, 'Check number of tests');
! $CONTROLLER->cgi(CGI->new({num => 0}));
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 202,206 ----
is(@{$RECORDER->tests}, 2, 'Check number of tests');
! $CONTROLLER->heap->{cgi} = CGI->new({num => 0});
delete_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 217,223 ****
$RECORDER->filter({});
! $CONTROLLER->cgi(CGI->new({type => 'header',
! field => 'Content-Type',
! value => 'text'}));
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 216,222 ----
$RECORDER->filter({});
! $CONTROLLER->heap->{cgi} = CGI->new({type => 'header',
! field => 'Content-Type',
! value => 'text'});
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 226,232 ****
'Test if Content-Type header filter is set');
! $CONTROLLER->cgi(CGI->new({type => 'header',
! field => 'Content-Type',
! value => ''}));
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 225,231 ----
'Test if Content-Type header filter is set');
! $CONTROLLER->heap->{cgi} = CGI->new({type => 'header',
! field => 'Content-Type',
! value => ''});
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
***************
*** 235,241 ****
'Test if Content-Type header filter is removed');
! $CONTROLLER->cgi(CGI->new({type => 'header',
! field => 'Location',
! value => '.'}));
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
--- 234,240 ----
'Test if Content-Type header filter is removed');
! $CONTROLLER->heap->{cgi} = CGI->new({type => 'header',
! field => 'Location',
! value => '.'});
filter_action($CONTROLLER);
is($CONTROLLER->heap->{response}->code, RC_FOUND);
|