From 358f2770178547abcb9216285fe670a7a1e102d4 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 26 May 2016 21:56:50 +0200 Subject: [PATCH] Bug 16500: [QA Follow-up] Catch warning if branch MPL already exists MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The current test had no warnings, when you have no MPL branch, and only catches the warn from the second build on line 57. If you do have MPL, a warning comes from line 56. This patch fixes it by removing MPL from the test. A new branch is created first and then we try to create it again. Test plan: Run the test. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 63fbb336bd90991a8b86ca6fe54d5a069c129373) Signed-off-by: Frédéric Demians --- t/db_dependent/TestBuilder.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t index 724f32def1..569b6b43c4 100644 --- a/t/db_dependent/TestBuilder.t +++ b/t/db_dependent/TestBuilder.t @@ -52,8 +52,8 @@ subtest 'Start with some trivial tests' => sub { 'Build should not accept a hash for this column'; # return undef if a record exists - my $param = { source => 'Branch', value => { branchcode => 'MPL' } }; - $builder->build( $param ); # at least it should exist now + my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; + my $param = { source => 'Branch', value => { branchcode => $branchcode } }; warning_like { $builder->build( $param ) } qr/Violation of unique constraint/, 'Catch warn on adding existing record'; -- 2.39.5