From f129cc3db2eb14be04ae9482f783f6b3f843fd34 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 26 Feb 2016 10:46:49 +0000 Subject: [PATCH] Reword the add service page Without the preview service name we probably have to go back to communicating a bit more on the add service page. This commit brings back the two bullet points about where the service name will appear, and tries to tie it into the nice words that Matt Sheret wrote for us. --- app/main/forms.py | 4 ++-- app/templates/views/add-service.html | 21 +++++++++++++++++---- tests/app/main/test_add_service_form.py | 2 +- tests/app/main/views/test_add_service.py | 4 ++-- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index a2885fe8f..7bb000cc7 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -164,13 +164,13 @@ class AddServiceForm(Form): name = StringField( 'Service name', validators=[ - DataRequired(message='Service name can not be empty') + DataRequired(message='Service name can’t be empty') ] ) def validate_name(self, a): if a.data in self._names_func(): - raise ValidationError('Service name already exists') + raise ValidationError('This service name is already in use') class ServiceNameForm(Form): diff --git a/app/templates/views/add-service.html b/app/templates/views/add-service.html index f0b4a5ff7..ec03a91e9 100644 --- a/app/templates/views/add-service.html +++ b/app/templates/views/add-service.html @@ -16,16 +16,29 @@

- Be specific. Remember that there might be other people in your - organisation using GOV.UK Notify. + Be specific to your service. Remember that there might be + other people in your organisation using GOV.UK Notify.

+

+ Users will see this: +

+ + +
{{ textbox(form.name, hint="You can change this later") }} - - {{ page_footer('Continue') }} + {{ page_footer('Add service') }}
diff --git a/tests/app/main/test_add_service_form.py b/tests/app/main/test_add_service_form.py index a89170c1e..ca021b741 100644 --- a/tests/app/main/test_add_service_form.py +++ b/tests/app/main/test_add_service_form.py @@ -9,4 +9,4 @@ def test_form_should_have_errors_when_duplicate_service_is_added(app_): form = AddServiceForm(_get_form_names, formdata=MultiDict([('name', 'some service')])) form.validate() - assert {'name': ['Service name already exists']} == form.errors + assert {'name': ['This service name is already in use']} == form.errors diff --git a/tests/app/main/views/test_add_service.py b/tests/app/main/views/test_add_service.py index 4661aa641..c5a4fc9e7 100644 --- a/tests/app/main/views/test_add_service.py +++ b/tests/app/main/views/test_add_service.py @@ -47,7 +47,7 @@ def test_should_return_form_errors_when_service_name_is_empty(app_, client.login(api_user_active) response = client.post(url_for('main.add_service'), data={}) assert response.status_code == 200 - assert 'Service name can not be empty' in response.get_data(as_text=True) + assert 'Service name can’t be empty' in response.get_data(as_text=True) def test_should_return_form_errors_with_duplicate_service_name(app_, @@ -62,5 +62,5 @@ def test_should_return_form_errors_with_duplicate_service_name(app_, response = client.post( url_for('main.add_service'), data={'name': 'service_one'}) assert response.status_code == 200 - assert 'Service name already exists' in response.get_data(as_text=True) + assert 'This service name is already in use' in response.get_data(as_text=True) assert mock_get_services.called