def test_show(self, create_gist):
        gist = create_gist('gist-show-me')
        response = self.app.get(url('gist', gist_id=gist.gist_access_id))

        response.mustcontain('added file: gist-show-me<')

        assert_response = AssertResponse(response)
        assert_response.element_equals_to(
            'div.rc-user span.user',
            '<span class="user"> %s</span>' % h.link_to_user('test_admin'))

        response.mustcontain('gist-desc')
    def test_show_acl_private(self, create_gist):
        gist = create_gist('gist-show-me-only-when-im-logged-in',
                           acl_level=Gist.ACL_LEVEL_PRIVATE)
        self.app.get(url('gist', gist_id=gist.gist_access_id), status=404)

        # now we log-in we should see thi gist
        self.log_user()
        response = self.app.get(url('gist', gist_id=gist.gist_access_id))
        response.mustcontain('added file: gist-show-me-only-when-im-logged-in')

        assert_response = AssertResponse(response)
        assert_response.element_equals_to(
            'div.rc-user span.user',
            '<span class="user"> %s</span>' % h.link_to_user('test_admin'))
        response.mustcontain('gist-desc')