From dfa4a884b90fee2505e1ced0ecdcfd8ea8070747 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Thu, 5 Jan 2017 15:02:19 +0200 Subject: [PATCH] TT#7029 Make subscribers API tests more stable Take [1] of the created members and groups, to avoid special pilot behavior. Pilot don't keep pbx group members Change-Id: Ib8fd599ffc53c9743d2c160d324f2110548bcea9 --- t/api-rest/api-subscribers.t | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/t/api-rest/api-subscribers.t b/t/api-rest/api-subscribers.t index 5fc765ae97..c6ad97a3b7 100644 --- a/t/api-rest/api-subscribers.t +++ b/t/api-rest/api-subscribers.t @@ -226,18 +226,19 @@ if($remote_config->{config}->{features}->{cloudpbx}){ diag("5415: check that groups management doesn't change members order;\n"); diag("5415:Set members order for the group;\n"); - $groups->[0]->{content}->{pbx_groupmember_ids} = [ map { $members->[$_]->{content}->{id} } ( 0, 2, 1 ) ]; - $test_machine->check_put2get($groups->[0]); + $groups->[1]->{content}->{pbx_groupmember_ids} = [ map { $members->[$_]->{content}->{id} } ( 0, 2, 1 ) ]; + + $test_machine->check_put2get($groups->[1]); diag("5415:Touch one of the members;\n"); - $members->[0]->{content}->{pbx_group_ids} = [ map { $groups->[$_]->{content}->{id} } (2,1)]; - my($res,$content) = $test_machine->request_put(@{$members->[0]}{qw/content location/}); + $members->[1]->{content}->{pbx_group_ids} = [ map { $groups->[$_]->{content}->{id} } (2,1)]; + my($res,$content) = $test_machine->request_put(@{$members->[1]}{qw/content location/}); $test_machine->http_code_msg(200, "PUT for groups was successful", $res, $content); diag("5415:Check members order in the group;\n"); - my(undef, $group_get_after) = $test_machine->check_item_get($groups->[0]->{location}); + my(undef, $group_get_after) = $test_machine->check_item_get($groups->[1]->{location}); - is_deeply($groups->[0]->{content}->{pbx_groupmember_ids}, $group_get_after->{pbx_groupmember_ids}, "Check group members order after touching it's member"); + is_deeply($groups->[1]->{content}->{pbx_groupmember_ids}, $group_get_after->{pbx_groupmember_ids}, "Check group members order after touching it's member"); $test_machine->clear_test_data_all();#fake data aren't registered in this test machine, so they will stay.