Add confirm loop

For pages where
- we want you to be sure that you want to do what you’re about to do
- we want to be sure it’s you trying to do the thing

This adds a page that asks the user to confirm their password.
This commit is contained in:
Chris Hill-Scott
2016-01-07 16:24:43 +00:00
parent 3989d1b576
commit 0b62d1e755
12 changed files with 227 additions and 82 deletions

View File

@@ -9,7 +9,7 @@ def test_should_show_service_name(notifications_admin):
response = notifications_admin.test_client().get('/service-settings/name')
assert response.status_code == 200
assert 'Service name' in response.get_data(as_text=True)
assert 'Rename service' in response.get_data(as_text=True)
def test_should_redirect_after_change_service_name(notifications_admin):
@@ -19,11 +19,25 @@ def test_should_redirect_after_change_service_name(notifications_admin):
assert 'http://localhost/service-settings' == response.location
def test_should_show_service_name_confirmation(notifications_admin):
response = notifications_admin.test_client().get('/service-settings/name/confirm')
assert response.status_code == 200
assert 'Rename service' in response.get_data(as_text=True)
def test_should_redirect_after_service_name_confirmation(notifications_admin):
response = notifications_admin.test_client().post('/service-settings/name/confirm')
assert response.status_code == 302
assert 'http://localhost/service-settings' == response.location
def test_should_show_request_to_go_live(notifications_admin):
response = notifications_admin.test_client().get('/service-settings/request-to-go-live')
assert response.status_code == 200
assert 'Request to go live' in response.get_data(as_text=True)
assert 'Request to make service live' in response.get_data(as_text=True)
def test_should_redirect_after_request_to_go_live(notifications_admin):
@@ -37,12 +51,26 @@ def test_should_show_status_page(notifications_admin):
response = notifications_admin.test_client().get('/service-settings/status')
assert response.status_code == 200
assert 'Suspend your service' in response.get_data(as_text=True)
assert 'Turn off outgoing messages' in response.get_data(as_text=True)
def test_should_show_redirect_after_status_change(notifications_admin):
response = notifications_admin.test_client().post('/service-settings/status')
assert response.status_code == 302
assert 'http://localhost/service-settings/status/confirm' == response.location
def test_should_show_status_confirmation(notifications_admin):
response = notifications_admin.test_client().get('/service-settings/status/confirm')
assert response.status_code == 200
assert 'Turn off outgoing messages' in response.get_data(as_text=True)
def test_should_redirect_after_status_confirmation(notifications_admin):
response = notifications_admin.test_client().post('/service-settings/status/confirm')
assert response.status_code == 302
assert 'http://localhost/service-settings' == response.location
@@ -58,4 +86,18 @@ def test_should_show_redirect_after_deleting_service(notifications_admin):
response = notifications_admin.test_client().post('/service-settings/delete')
assert response.status_code == 302
assert 'http://localhost/' == response.location
assert 'http://localhost/service-settings/delete/confirm' == response.location
def test_should_show_delete_confirmation(notifications_admin):
response = notifications_admin.test_client().get('/service-settings/delete/confirm')
assert response.status_code == 200
assert 'Delete service' in response.get_data(as_text=True)
def test_should_redirect_delete_confirmation(notifications_admin):
response = notifications_admin.test_client().post('/service-settings/delete/confirm')
assert response.status_code == 302
assert 'http://localhost/dashboard' == response.location