From 1df1a7b9ea4cd24235d344d495a874de40624612 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 31 Aug 2016 00:24:56 -0400 Subject: - Fixed API tests to work after login/email changes --- xt/lib/QA/RPC.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'xt/lib/QA/RPC.pm') diff --git a/xt/lib/QA/RPC.pm b/xt/lib/QA/RPC.pm index e2f1f7597..93414e231 100644 --- a/xt/lib/QA/RPC.pm +++ b/xt/lib/QA/RPC.pm @@ -236,7 +236,9 @@ sub bz_run_tests { } sub bz_test_bug { - my ($self, $fields, $bug, $expect, $t, $creation_time) = @_; + my ($self, $fields, $bug, $orig_expect, $t, $creation_time) = @_; + + my $expect = dclone($orig_expect); foreach my $field (sort @$fields) { # "description" is used by Bug.create but comments are not returned @@ -253,6 +255,12 @@ sub bz_test_bug { next; } + foreach my $field (qw(assigned_to creator qa_contact)) { + if (!$t->{user}) { + $expect->{$field} = email_filter($expect->{$field}); + } + } + if ($field =~ /^is_/) { ok(defined $bug->{$field}, $self->TYPE . ": $field is not null"); is($bug->{$field} ? 1 : 0, $expect->{$field} ? 1 : 0, @@ -260,6 +268,7 @@ sub bz_test_bug { } elsif ($field eq 'cc') { foreach my $cc_item (@{ $expect->{cc} || [] }) { + $cc_item = email_filter($cc_item) if !$t->{user}; ok(grep($_ eq $cc_item, @{ $bug->{cc} }), $self->TYPE . ": $field contains $cc_item"); } -- cgit v1.2.3-24-g4f1b