Redirect to the dashboard after the tour

After the tour we should ground users by dropping them on the dashboard.

In the background, we delete the example text message template. This
means that users start from a clean slate when they go to add their own
templates

This also means some wording changes to the tour so it still makes
(some) sense:

- 1, 2 and 3 should refer to the current step, not describe the next
  one
- the link should take you to the dashboard
- change from ‘Get started’ to ‘Try this example’ because we’re using
  ‘Get started on the dashboard’
This commit is contained in:
Chris Hill-Scott
2016-07-01 10:49:54 +01:00
parent a5a35f1a6b
commit 721212816d
3 changed files with 40 additions and 8 deletions

View File

@@ -696,3 +696,26 @@ def test_send_and_check_page_renders_if_no_statistics(
page = BeautifulSoup(resp.data.decode('utf-8'), 'html.parser')
assert page.h1.text.strip() == 'Check and confirm'
mock_get_stats.assert_called_once_with(fake_uuid, today)
def test_go_to_dashboard_after_tour(
app_,
mocker,
api_user_active,
mock_login,
mock_get_service,
mock_has_permissions,
mock_delete_service_template,
fake_uuid
):
with app_.test_request_context(), app_.test_client() as client:
client.login(api_user_active)
resp = client.get(
url_for('main.go_to_dashboard_after_tour', service_id=fake_uuid, example_template_id=fake_uuid)
)
assert resp.status_code == 302
assert resp.location == url_for("main.service_dashboard", service_id=fake_uuid, _external=True)
mock_delete_service_template.assert_called_once_with(fake_uuid, fake_uuid)