'GitLab webhook should only build active versions'

def test_gitlab_post_commit_hook_builds_branch_docs_if_it_should(self):

    r = self.client.post('/gitlab/', data=json.dumps(self.payload), content_type='application/json')
    self.assertContains(r, '(URL    Build)    Build    Started:    github.com/rtfd/readthedocs.org    [awesome]')
    self.payload['ref'] = 'refs/heads/not_ok'
    r = self.client.post('/gitlab/', data=json.dumps(self.payload), content_type='application/json')
    self.assertContains(r, '(URL    Build)    Not    Building:    github.com/rtfd/readthedocs.org    [not_ok]')
    self.payload['ref'] = 'refs/heads/unknown'
    r = self.client.post('/gitlab/', data=json.dumps(self.payload), content_type='application/json')
    self.assertContains(r, '(URL    Build)    No    known    branches    were    pushed    to.')
