mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04:00
Merge with master.
This commit is contained in:
6
tests/app/main/views/test_dashboard.py
Normal file
6
tests/app/main/views/test_dashboard.py
Normal file
@@ -0,0 +1,6 @@
|
||||
def test_should_show_recent_jobs_on_dashboard(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/dashboard')
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Test message 1' in response.get_data(as_text=True)
|
||||
assert 'Asdfgg' in response.get_data(as_text=True)
|
||||
22
tests/app/main/views/test_jobs.py
Normal file
22
tests/app/main/views/test_jobs.py
Normal file
@@ -0,0 +1,22 @@
|
||||
def test_should_return_list_of_all_jobs(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/jobs')
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Test message 1' in response.get_data(as_text=True)
|
||||
assert 'Final reminder' in response.get_data(as_text=True)
|
||||
|
||||
|
||||
def test_should_show_page_for_one_job(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/jobs/job')
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'dispatch_20151114.csv' in response.get_data(as_text=True)
|
||||
assert 'Test message 1' in response.get_data(as_text=True)
|
||||
|
||||
|
||||
def test_should_show_page_for_one_notification(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/jobs/job/notification/3')
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Text message' in response.get_data(as_text=True)
|
||||
assert '+44 7700 900 522' in response.get_data(as_text=True)
|
||||
27
tests/app/main/views/test_sms.py
Normal file
27
tests/app/main/views/test_sms.py
Normal file
@@ -0,0 +1,27 @@
|
||||
def test_should_return_sms_template_picker(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/sms/send')
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Choose text message template' in response.get_data(as_text=True)
|
||||
|
||||
|
||||
def test_should_redirect_to_sms_check_page(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/sms/send')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/sms/check'
|
||||
|
||||
|
||||
def test_should_return_check_sms_page(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/sms/check')
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Check and confirm' in response.get_data(as_text=True)
|
||||
assert 'Send 10 text messages' in response.get_data(as_text=True)
|
||||
|
||||
|
||||
def test_should_redirect_to_job(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/sms/check')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/jobs/job'
|
||||
17
tests/app/main/views/test_templates.py
Normal file
17
tests/app/main/views/test_templates.py
Normal file
@@ -0,0 +1,17 @@
|
||||
def test_should_return_list_of_all_templates(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/templates')
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_show_page_for_one_templates(notifications_admin):
|
||||
response = notifications_admin.test_client().get('/templates/template')
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_should_redirect_when_saving_a_template(notifications_admin):
|
||||
response = notifications_admin.test_client().post('/templates/template')
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == 'http://localhost/templates'
|
||||
Reference in New Issue
Block a user