Merge pull request #744 from alphagov/tour-to-dashboard

Go to the dashboard after finishing the tour
This commit is contained in:
Chris Hill-Scott
2016-07-01 14:18:08 +01:00
committed by GitHub
9 changed files with 68 additions and 40 deletions

View File

@@ -35,7 +35,7 @@ def test_should_add_service_and_redirect_to_tour_when_no_services(app_,
user_id=api_user_active.id,
email_from='testing.the.post'
)
assert len(mock_create_service_template.call_args_list) == 2
assert len(mock_create_service_template.call_args_list) == 1
assert session['service_id'] == 101
assert response.status_code == 302
assert response.location == url_for(

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)