Commit 2eb3dd38 authored by Sean Arnold's avatar Sean Arnold

Return incidents as array inside object

parent 5ea90fa9
......@@ -5,7 +5,7 @@ module StatusPage
entity IncidentEntity
def represent_list(resource)
represent(resource, except: [:comments])
{ incidents: represent(resource, except: [:comments]) }
end
def represent_details(resource, user_notes)
......
{
"type": "array",
"items": { "$ref": "basic_incident.json" },
"type": "object",
"required": ["incidents"],
"properties": {
"incidents": {
"type": "array",
"items": { "$ref": "basic_incident.json" }
}
},
"additionalProperties": false
}
......@@ -14,7 +14,7 @@ describe StatusPage::IncidentSerializer do
describe '.represent_list' do
let(:resource) { [issue] }
let(:json_entity) do
subject.represent_list(resource).map(&:with_indifferent_access)
subject.represent_list(resource).with_indifferent_access
end
it_behaves_like 'valid JSON schema', schema: 'status_page/incident_list'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment