'GitLab webhook API'

def test_gitlab_webhook(self, trigger_build):

    client = APIClient()
    resp = client.post('/api/v2/webhook/gitlab/{0}/'.format(self.project.slug), {'object_kind': 'push', 'ref': 'master'}, format='json')
    trigger_build.assert_has_calls([mock.call(force=True, version=mock.ANY, project=self.project)])
    resp = client.post('/api/v2/webhook/gitlab/{0}/'.format(self.project.slug), {'object_kind': 'push', 'ref': 'non-existent'}, format='json')
    trigger_build.assert_has_calls([mock.call(force=True, version=mock.ANY, project=self.project)])
