mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-05 06:01:46 -04:00
Allow broadcasts to be cancelled
Currently this is a `get` request from the dashboard. Once we have a page for viewing an individual broadcast it should probably show there instead and be a `get`/confirm/`post` loop like for deleting a template.
This commit is contained in:
@@ -78,7 +78,7 @@ def test_broadcast_dashboard(
|
||||
assert [
|
||||
normalize_spaces(row.text) for row in page.select('table')[0].select('tbody tr')
|
||||
] == [
|
||||
'Example template To England and Scotland Live until tomorrow at 2:20am',
|
||||
'Example template To England and Scotland Live until tomorrow at 2:20am Stop broadcasting',
|
||||
]
|
||||
assert [
|
||||
normalize_spaces(row.text) for row in page.select('table')[1].select('tbody tr')
|
||||
@@ -275,3 +275,28 @@ def test_start_broadcasting(
|
||||
service_id=SERVICE_ONE_ID,
|
||||
broadcast_message_id=fake_uuid,
|
||||
)
|
||||
|
||||
|
||||
def test_cancel_broadcast(
|
||||
client_request,
|
||||
service_one,
|
||||
mock_get_draft_broadcast_message,
|
||||
mock_update_broadcast_message_status,
|
||||
fake_uuid,
|
||||
):
|
||||
service_one['permissions'] += ['broadcast']
|
||||
client_request.get(
|
||||
'.cancel_broadcast_message',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
broadcast_message_id=fake_uuid,
|
||||
_expected_redirect=url_for(
|
||||
'.broadcast_dashboard',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
_external=True,
|
||||
),
|
||||
),
|
||||
mock_update_broadcast_message_status.assert_called_once_with(
|
||||
'cancelled',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
broadcast_message_id=fake_uuid,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user