diff --git a/tests/test_rendering.py b/tests/test_rendering.py index 25f97de79..f693e0229 100644 --- a/tests/test_rendering.py +++ b/tests/test_rendering.py @@ -52,13 +52,15 @@ def test_titles(self): ('/issues', 'Issues'), ('issues/new', 'New Issue'), ('/privacy', 'Privacy Policy'), + ('/dashboard/triage', 'Triage Dashboard'), ('/404', defaultTitle) ] - for uri, title in website_uris: - rv = self.app.get(uri, environ_base=headers) - expected = '{title} | webcompat.com'.format( - title=title) - self.assertTrue(expected in rv.data) + with webcompat.app.app_context(): + for uri, title in website_uris: + rv = self.app.get(uri, environ_base=headers) + expected = '{title} | webcompat.com'.format( + title=title) + self.assertTrue(expected in rv.data) def test_user_title_pages(self): """Testing user activity page title.""" diff --git a/tests/test_urls.py b/tests/test_urls.py index 1fa8867ff..8ca06269b 100644 --- a/tests/test_urls.py +++ b/tests/test_urls.py @@ -132,6 +132,29 @@ def test_new_issue_should_not_crash(self): rv = self.app.post('/issues/new', data=data) self.assertEqual(rv.status_code, 400) + def test_dashboard_triage(self): + """Request to /dashboard/triage should be 200.""" + rv = self.app.get('/dashboard/triage') + self.assertEqual(rv.status_code, 200) + self.assertTrue('

Triage Dashboard

' in rv.data) + self.assertTrue('text/html' in rv.content_type) + + def test_dashboard_route(self): + """Request to /dashboard should be 404. + + For now, the dashboard route has no purpose. + """ + rv = self.app.get('/dashboard/') + content_test = 'Lost in Punk Cat Space (404)' in rv.data + self.assertEqual(rv.status_code, 404) + self.assertTrue('text/html' in rv.content_type) + self.assertTrue(content_test) + rv = self.app.get('/dashboard') + content_test = 'Lost in Punk Cat Space (404)' in rv.data + self.assertEqual(rv.status_code, 404) + self.assertTrue('text/html' in rv.content_type) + self.assertTrue(content_test) + if __name__ == '__main__': unittest.main()