summaryrefslogtreecommitdiffstats
path: root/xt/lib/QA/RPC.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-08-31 06:24:56 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-08-31 06:24:56 +0200
commit1df1a7b9ea4cd24235d344d495a874de40624612 (patch)
treef09a46880a81149cceceabe466cec1ea74d8d80b /xt/lib/QA/RPC.pm
parent3a903b41328ba20072570c9fde36b332ea082f03 (diff)
downloadbugzilla-1df1a7b9ea4cd24235d344d495a874de40624612.tar.gz
bugzilla-1df1a7b9ea4cd24235d344d495a874de40624612.tar.xz
- Fixed API tests to work after login/email changes
Diffstat (limited to 'xt/lib/QA/RPC.pm')
-rw-r--r--xt/lib/QA/RPC.pm11
1 files changed, 10 insertions, 1 deletions
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");
}