From 0a0cb09397284df378c00f09e812c9d76ca2a556 Mon Sep 17 00:00:00 2001 From: David Delikat Date: Wed, 22 Feb 2012 17:55:25 +0000 Subject: [PATCH 1/4] changed plan from 53 to 57 --- t/Asset/Wobject/Survey.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/Asset/Wobject/Survey.t b/t/Asset/Wobject/Survey.t index 0b615412f0..3af842adde 100644 --- a/t/Asset/Wobject/Survey.t +++ b/t/Asset/Wobject/Survey.t @@ -17,7 +17,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -plan tests => 53; +plan tests => 57; #---------------------------------------------------------------------------- # put your tests here From 1612067b3a5636e118cc8bb0f9da959b6f048f00 Mon Sep 17 00:00:00 2001 From: David Delikat Date: Thu, 23 Feb 2012 20:42:59 +0000 Subject: [PATCH 2/4] assign default empty array to priv properties --- lib/WebGUI/Middleware/WGAccess.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/WebGUI/Middleware/WGAccess.pm b/lib/WebGUI/Middleware/WGAccess.pm index a51fed001d..686c2a8281 100644 --- a/lib/WebGUI/Middleware/WGAccess.pm +++ b/lib/WebGUI/Middleware/WGAccess.pm @@ -59,6 +59,10 @@ sub call { else { $privs = JSON->new->utf8->decode($contents); } + # in some cases there is nothing but state; default each list to an empty array + $privs->{user} ||= [ ]; + $privs->{groups} ||= [ ]; + $privs->{assets} ||= [ ]; return @$r = (403, [ 'Content-Type' => 'text/plain' ], [ 'Forbidden' ]) if $privs->{state} eq 'trash'; From e6535e4d1897ec86cc7ce21981db826b4ef93ccd Mon Sep 17 00:00:00 2001 From: David Delikat Date: Thu, 23 Feb 2012 22:36:59 +0000 Subject: [PATCH 3/4] removed WebGUI::Utility and WebGUI::Cache because they no longer exist; no other changes as all tests are skipped --- t/Group/ldap_groups.t | 2 -- 1 file changed, 2 deletions(-) diff --git a/t/Group/ldap_groups.t b/t/Group/ldap_groups.t index 998fe4cb8e..a6cbe6987f 100644 --- a/t/Group/ldap_groups.t +++ b/t/Group/ldap_groups.t @@ -14,11 +14,9 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; -use WebGUI::Utility; use WebGUI::User; use WebGUI::Group; -use WebGUI::Cache; use Test::More skip_all => 'Disabled until the test LDAP server is rejuvenated'; use Test::Deep; From fec47c110d283f2b0c5aff3865d9c692087583bb Mon Sep 17 00:00:00 2001 From: David Delikat Date: Thu, 23 Feb 2012 22:39:56 +0000 Subject: [PATCH 4/4] fixed test for approval --- t/Asset/EMSSubmissionForm.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/Asset/EMSSubmissionForm.t b/t/Asset/EMSSubmissionForm.t index f81a6b2d26..57df258664 100644 --- a/t/Asset/EMSSubmissionForm.t +++ b/t/Asset/EMSSubmissionForm.t @@ -348,7 +348,7 @@ $sub1 = $sub1->cloneFromDb; diag $sub1->submissionStatus; diag $sub1->ticketId; diag $sub1->getRevisionCount; -is( $sub1->get('submissionStatus'),'created','approval successfull'); +is( $sub1->get('submissionStatus'),'approved','approval successfull'); my $ticket = eval { WebGUI::Asset->newById($session, $sub1->get('ticketId')); }; my $e = Exception::Class->caught();