mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Merge pull request #370 from alphagov/add-tour
Make first time use clearer
This commit is contained in:
@@ -26,7 +26,7 @@ def test_should_add_service_and_redirect_to_next_page(app_,
|
||||
url_for('main.add_service'),
|
||||
data={'name': 'testing the post'})
|
||||
assert response.status_code == 302
|
||||
assert response.location == url_for('main.service_dashboard', service_id=101, _external=True)
|
||||
assert response.location == url_for('main.tour', service_id=101, page=1, _external=True)
|
||||
assert mock_get_services.called
|
||||
mock_create_service.asset_called_once_with(service_name='testing the post',
|
||||
active=False,
|
||||
@@ -44,7 +44,7 @@ def test_should_return_form_errors_when_service_name_is_empty(app_,
|
||||
client.login(api_user_active, mocker)
|
||||
response = client.post(url_for('main.add_service'), data={})
|
||||
assert response.status_code == 200
|
||||
assert 'Service name can’t be empty' in response.get_data(as_text=True)
|
||||
assert 'Can’t be empty' in response.get_data(as_text=True)
|
||||
|
||||
|
||||
def test_should_return_form_errors_with_duplicate_service_name_regardless_of_case(app_,
|
||||
|
||||
@@ -260,7 +260,7 @@ def test_user_cant_invite_themselves(
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
assert page.h1.string.strip() == 'Invite a team member'
|
||||
form_error = page.find('span', class_='error-message').string.strip()
|
||||
assert form_error == "You can't send an invitation to yourself"
|
||||
assert form_error == "You can’t send an invitation to yourself"
|
||||
assert not mock_create_invite.called
|
||||
|
||||
|
||||
|
||||
19
tests/app/main/views/test_tour.py
Normal file
19
tests/app/main/views/test_tour.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from flask import url_for
|
||||
|
||||
import app
|
||||
|
||||
|
||||
@pytest.mark.parametrize("page", range(1, 5))
|
||||
def test_should_render_tour_pages(
|
||||
app_,
|
||||
api_user_active,
|
||||
mocker,
|
||||
page
|
||||
):
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
client.login(api_user_active, mocker)
|
||||
response = client.get(url_for('main.tour', service_id=101, page=page))
|
||||
assert response.status_code == 200
|
||||
assert 'Next' in response.get_data(as_text=True)
|
||||
Reference in New Issue
Block a user