Serve robots.txt from the admin app

We’re getting rid of the PaaS proxy, which is where this file is
currently served from.

Values copied from 3632313fdf/ansible/roles/nginx/files/robots.txt
This commit is contained in:
Chris Hill-Scott
2018-08-29 15:41:53 +01:00
parent 162fd3773e
commit 09876532ae
3 changed files with 29 additions and 0 deletions

View File

@@ -40,6 +40,20 @@ def test_logged_in_user_redirects_to_choose_account(
assert response.location == url_for('main.choose_account', _external=True)
def test_robots(client):
assert url_for('main.robots') == '/robots.txt'
response = client.get(url_for('main.robots'))
assert response.headers['Content-Type'] == 'text/plain'
assert response.status_code == 200
assert response.get_data(as_text=True) == (
'User-agent: *\n'
'Disallow: /sign-in\n'
'Disallow: /support\n'
'Disallow: /support/\n'
'Disallow: /register\n'
)
@pytest.mark.parametrize('view', [
'cookies', 'privacy', 'using_notify', 'pricing', 'terms', 'integration_testing', 'roadmap',
'features', 'callbacks', 'documentation', 'security'