From bc9c7a2b1d584f506c27d24f8088175396b98240 Mon Sep 17 00:00:00 2001 From: dklawren Date: Thu, 25 Oct 2018 18:05:50 -0400 Subject: [PATCH] Bug 1502181 - MockParams should set user/verify authentication classes to match production --- Bugzilla/Test/MockParams.pm | 6 +++++- t/mojo-example.t | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Test/MockParams.pm b/Bugzilla/Test/MockParams.pm index 2d064c616..ca582a5a1 100644 --- a/Bugzilla/Test/MockParams.pm +++ b/Bugzilla/Test/MockParams.pm @@ -58,6 +58,10 @@ sub import { ], ); + # prod-like defaults + $answers{user_info_class} //= 'GitHubAuth,CGI'; + $answers{user_verify_class} //= 'GitHubAuth,DB'; + if ($first_time++) { capture_merged { Bugzilla::Config::update_params(); @@ -68,4 +72,4 @@ sub import { } } -1; \ No newline at end of file +1; diff --git a/t/mojo-example.t b/t/mojo-example.t index 8ed4835da..3858025a7 100644 --- a/t/mojo-example.t +++ b/t/mojo-example.t @@ -69,8 +69,8 @@ $t->json_is('/id' => $api_user->id); # Each time you call $t->get_ok, post_ok, etc the previous request is cleared. $t->get_ok('/rest/whoami'); -$t->status_is(200); -$t->json_is('/name' => ''); -$t->json_is('/id' => 0); +$t->status_is(401); +$t->json_is('/name' => undef); +$t->json_is('/id' => undef); done_testing; -- 2.47.3