[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3076] trunk/t



Revision: 3076
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3076&view=rev
Author:   einhverfr
Date:     2010-09-30 22:35:50 +0000 (Thu, 30 Sep 2010)

Log Message:
-----------
Correcting some test cases for LWP tests and the XSRF framework

Modified Paths:
--------------
    trunk/t/63-lwp.t
    trunk/t/data/62-request-data

Modified: trunk/t/63-lwp.t
===================================================================
--- trunk/t/63-lwp.t	2010-09-30 22:09:45 UTC (rev 3075)
+++ trunk/t/63-lwp.t	2010-09-30 22:35:50 UTC (rev 3076)
@@ -19,7 +19,8 @@
 $host =~ /https?:\/\/([^\/]+)\//;
 $hostname = $1;
 my $db = $ENV{LSMB_NEW_DB} || $ENV{PGDATABASE};
-my @test_request_data = do { 't/data/62-request-data' };
+#my $test_request_data = use { 't/data/62-request-data' };
+do 't/data/62-request-data';
 my $browser = LWP::UserAgent->new( );
 if ($host !~ /https?:.+:/){
 	if ($host =~ /http:/){
@@ -43,7 +44,7 @@
 $cookie->extract_cookies($response);
 $browser->cookie_jar($cookie);
 
-for my $test (@test_request_data){
+for my $test (@$test_request_data){
 	next if $test->{_skip_lwp};
 	my $argstr = "";
     my $module = "";
@@ -80,7 +81,7 @@
     }
 	ok($response->is_success(), $retstr)
 		|| print STDERR "# " .$response->status_line() . ":$url\n";
-	if ( ( defined $test->{format} ) && ($test->{format} eq 'PDF' ) ){
+	if ( ( defined $test->{format} ) && ($test->{format} eq 'PDF' and defined $test->{form_id}) ){
 		cmp_ok($response->header('content-type'), 'eq', 
 			'application/pdf', "$test->{_test_id} PDF sent");
 	} else {

Modified: trunk/t/data/62-request-data
===================================================================
--- trunk/t/data/62-request-data	2010-09-30 22:09:45 UTC (rev 3075)
+++ trunk/t/data/62-request-data	2010-09-30 22:35:50 UTC (rev 3076)
@@ -338,6 +338,7 @@
 	# the following 4 tests check that it is possible to remove an empty batch
 	{
 		# access the batch creation screen
+		"_skip_lwp"             => 1,
 		"_test_id"		=> "AP Voucher Screen",
 		"_codebase"		=> "new",
 		"action"		=> "create_batch",
@@ -359,6 +360,7 @@
 	{
 		# create an empty batch
 		"_test_id"		=> "Create Empty Batch",
+		"_skip_lwp"             => 1,
 		"_codebase"		=> "new",
 		"action"		=> "create_vouchers",
 		"module"		=> "vouchers.pl",
@@ -376,6 +378,7 @@
 	{
 		# get the list of batches and save the first row of the list in GLOBAL
 		"_test_id"		=> "List Empty Batches",
+		"_skip_lwp"             => 1,
 		"_codebase"		=> "new",
 		"action"		=> "list_batches",
 		"empty"			=> 1,
@@ -400,6 +403,7 @@
 	{
 		# remove first row of the list of empty batches (obtained from GLOBAL)
 		"_test_id"		=> "Remove Empty Batches",
+		"_skip_lwp"             => 1,
 		"_codebase"		=> "new",
 		"module"		=> "vouchers.pl",
 		"form_id"		=> '_$GLOBAL$:form_id',


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.