From 2a031b352c90c3c79cfd0c7c0e132971a82406fb Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 14 May 2020 10:42:06 +0000 Subject: [PATCH] Bug 25482: Explicitly set macros as not shard during tests Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- Koha/REST/V1/AdvancedEditorMacro.pm | 2 -- t/db_dependent/api/v1/advanced_editor_macros.t | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/REST/V1/AdvancedEditorMacro.pm b/Koha/REST/V1/AdvancedEditorMacro.pm index 92077713cc..e94106242a 100644 --- a/Koha/REST/V1/AdvancedEditorMacro.pm +++ b/Koha/REST/V1/AdvancedEditorMacro.pm @@ -75,8 +75,6 @@ sub get { error => "This macro is shared, you must access it via advanced_editor/macros/shared" }); } - warn $macro->borrowernumber; - warn $patron->borrowernumber; if( $macro->borrowernumber != $patron->borrowernumber ){ return $c->render( status => 403, openapi => { error => "You do not have permission to access this macro" diff --git a/t/db_dependent/api/v1/advanced_editor_macros.t b/t/db_dependent/api/v1/advanced_editor_macros.t index e4a0625272..72fb17703c 100644 --- a/t/db_dependent/api/v1/advanced_editor_macros.t +++ b/t/db_dependent/api/v1/advanced_editor_macros.t @@ -56,6 +56,7 @@ subtest 'list() tests' => sub { name => 'Test1', macro => 'delete 100', borrowernumber => $patron_1->borrowernumber, + shared => 0, } }); my $macro_2 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value => @@ -63,7 +64,7 @@ subtest 'list() tests' => sub { name => 'Test2', macro => 'delete 100', borrowernumber => $patron_1->borrowernumber, - shared=> 1, + shared => 1, } }); my $macro_3 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value => @@ -71,6 +72,7 @@ subtest 'list() tests' => sub { name => 'Test3', macro => 'delete 100', borrowernumber => $patron_2->borrowernumber, + shared => 0, } }); my $macro_4 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value => -- 2.39.5