mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Added an endpoint that returns all letter jobs, ordered by created_at desc.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import uuid
|
||||
|
||||
from flask import current_app
|
||||
from flask import json
|
||||
|
||||
from app.schemas import job_schema
|
||||
from tests import create_authorization_header
|
||||
|
||||
|
||||
@@ -40,3 +40,15 @@ def test_send_letter_jobs_throws_validation_error(client, mocker):
|
||||
assert response.status_code == 400
|
||||
|
||||
assert not mock_celery.called
|
||||
|
||||
|
||||
def test_send_letter_jobs_throws_validation_error(client, sample_letter_job):
|
||||
auth_header = create_authorization_header()
|
||||
response = client.get(
|
||||
path='/letter-jobs',
|
||||
headers=[('Content-Type', 'application/json'), auth_header])
|
||||
|
||||
assert response.status_code == 200
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
assert len(json_resp['data']) == 0
|
||||
assert job_schema.dumps(sample_letter_job) == json_resp['data'][0]
|
||||
|
||||
Reference in New Issue
Block a user