Merge pull request #1777 from alphagov/service-name-hint

Correct description of how service name appears
This commit is contained in:
Chris Hill-Scott
2018-01-12 17:00:54 +00:00
committed by GitHub
2 changed files with 27 additions and 13 deletions

View File

@@ -10,13 +10,16 @@
<h1 class="heading-large">Change your service name</h1>
<div class="form-group">
<p>Users will see your service name:</p>
<ul class="list-bullet">
<li>at the start of every text message, eg Vehicle tax: we received your payment, thank you</li>
<li>as your email sender name</li>
</ul>
{% if current_service.prefix_sms %}
<p>Users will see your service name:</p>
<ul class="list-bullet">
<li>at the start of every text message, eg {{ current_service.name }}: This is an example message</li>
<li>as your email sender name</li>
</ul>
{% else %}
<p>Users will see your service name as your email sender name.</p>
{% endif %}
</div>
<form method="post">

View File

@@ -236,16 +236,27 @@ def test_escapes_letter_contact_block(
def test_should_show_service_name(
logged_in_client,
service_one,
client_request,
):
response = logged_in_client.get(url_for(
'main.service_name_change', service_id=service_one['id']))
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
page = client_request.get('main.service_name_change', service_id=SERVICE_ONE_ID)
assert page.find('h1').text == 'Change your service name'
assert page.find('input', attrs={"type": "text"})['value'] == 'service one'
app.service_api_client.get_service.assert_called_with(service_one['id'])
assert page.select_one('main p').text == 'Users will see your service name:'
assert normalize_spaces(page.select_one('main ul').text) == (
'at the start of every text message, eg service one: This is an example message '
'as your email sender name'
)
app.service_api_client.get_service.assert_called_with(SERVICE_ONE_ID)
def test_should_show_service_name_with_no_prefixing(
client_request,
service_one,
):
service_one['prefix_sms'] = False
page = client_request.get('main.service_name_change', service_id=SERVICE_ONE_ID)
assert page.find('h1').text == 'Change your service name'
assert page.select_one('main p').text == 'Users will see your service name as your email sender name.'
def test_should_redirect_after_change_service_name(