From c768f1350bd4346216e40a59a8ac7cefebc3e6c2 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 6 Sep 2024 15:14:13 -0400 Subject: [PATCH] tests: dnsexit2: Check number of requests --- t/protocol_dnsexit2.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/protocol_dnsexit2.pl b/t/protocol_dnsexit2.pl index 7da39a8..902a58b 100644 --- a/t/protocol_dnsexit2.pl +++ b/t/protocol_dnsexit2.pl @@ -79,6 +79,7 @@ subtest 'Testing nic_dnsexit2_update' => sub { }); test_nic_dnsexit2_update(\%config, 'host.my.zone.com'); my @requests = get_requests(); + is(scalar(@requests), 1, 'expected number of update requests'); is($requests[0]->{method}, 'POST', 'Method is correct'); is($requests[0]->{uri}, '/update', 'URI contains correct path'); like($requests[0]->{headers}, qr/Content-Type: application\/json/, 'Content-Type header is correct'); @@ -119,6 +120,7 @@ subtest 'Testing nic_dnsexit2_update without a zone set' => sub { }); test_nic_dnsexit2_update(\%config, 'myhost.zone.com'); my @requests = get_requests(); + is(scalar(@requests), 1, 'expected number of update requests'); my $data = decode_and_sort_array($requests[0]->{content}); my $expected_data = decode_and_sort_array({ 'domain' => 'myhost.zone.com',