diff --git a/server/events/vcs/gitlab_client_test.go b/server/events/vcs/gitlab_client_test.go index 8aee1e865a..10604d3ca9 100644 --- a/server/events/vcs/gitlab_client_test.go +++ b/server/events/vcs/gitlab_client_test.go @@ -816,6 +816,10 @@ func TestGitlabClient_PullIsMergeable(t *testing.T) { case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v", defaultMr): w.WriteHeader(http.StatusOK) w.Write(pipelineSuccess) // nolint: errcheck + case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v/approvals", c.mrID): + w.WriteHeader(http.StatusOK) + response := fmt.Sprintf(`{"id":%v,"name":"%s","rule_type":"regular","report_type":null,"eligible_approvers":[{"id":5,"name":"John Doe","username":"jdoe","state":"active","avatar_url":"https://www.gravatar.com/avatar/0?s=80&d=identicon","web_url":"http://localhost/jdoe"},{"id":50,"name":"Group Member 1","username":"group_member_1","state":"active","avatar_url":"https://www.gravatar.com/avatar/0?s=80&d=identicon","web_url":"http://localhost/group_member_1"}],"approvals_required":0,"users":[{"id":5,"name":"John Doe","username":"jdoe","state":"active","avatar_url":"https://www.gravatar.com/avatar/0?s=80&d=identicon","web_url":"http://localhost/jdoe"}],"contains_hidden_groups":false}`, c.mrID, c.statusName) + w.Write([]byte(response)) // nolint: errcheck case fmt.Sprintf("/api/v4/projects/runatlantis%%2Fatlantis/merge_requests/%v", noHeadPipelineMR): w.WriteHeader(http.StatusOK) w.Write(headPipelineNotAvailable) // nolint: errcheck