Commit cdae31c3 authored by Etienne Baqué's avatar Etienne Baqué

Fixed spec files and serializers based on review comments

Added iid to Milestone and Issue entities.
Adjusted rspec accordingly.
Added additionalProperties attribute to schemas.
parent 1e4cd02d
......@@ -6,6 +6,7 @@ class EvidenceIssueEntity < Grape::Entity
expose :description
expose :author, using: EvidenceAuthorEntity
expose :state
expose :iid
expose :confidential
expose :created_at
expose :due_date
......
......@@ -5,6 +5,7 @@ class EvidenceMilestoneEntity < Grape::Entity
expose :title
expose :description
expose :state
expose :iid
expose :created_at
expose :due_date
expose :issues, using: EvidenceIssueEntity
......
......@@ -2,7 +2,7 @@
class EvidenceReleaseEntity < Grape::Entity
expose :id
expose :tag
expose :tag, as: :tag_name
expose :name
expose :description
expose :created_at
......
......@@ -9,5 +9,6 @@
"id": { "type": "integer" },
"name": { "type": "string" },
"email": { "type": "string" }
}
},
"additionalProperties": false
}
......@@ -6,6 +6,7 @@
"description",
"author",
"state",
"iid",
"confidential",
"created_at",
"due_date"
......@@ -16,8 +17,10 @@
"description": { "type": "string" },
"author": { "$ref": "author.json" },
"state": { "type": "string" },
"iid": { "type": "integer" },
"confidential": { "type": "boolean" },
"created_at": { "type": "date" },
"due_date": { "type": "date" }
}
},
"additionalProperties": false
}
......@@ -5,6 +5,7 @@
"title",
"description",
"state",
"iid",
"created_at",
"due_date",
"issues"
......@@ -14,11 +15,13 @@
"title": { "type": "string" },
"description": { "type": "string" },
"state": { "type": "string" },
"iid": { "type": "integer" },
"created_at": { "type": "date" },
"due_date": { "type": "date" },
"issues": {
"type": "array",
"items": { "$ref": "issue.json" }
}
}
},
"additionalProperties": false
}
......@@ -11,5 +11,6 @@
"name": { "type": "string" },
"description": { "type": "string" },
"created_at": { "type": "date" }
}
},
"additionalProperties": false
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://example.com/release.schema.json",
"type": "object",
"required": [
"id",
......@@ -22,5 +20,6 @@
"type": "array",
"items": { "$ref": "milestone.json" }
}
}
},
"additionalProperties": false
}
......@@ -8,6 +8,6 @@ describe EvidenceIssueEntity do
subject { entity.as_json }
it 'exposes the expected fields' do
expect(subject.keys).to contain_exactly(:id, :title, :description, :author, :state, :confidential, :created_at, :due_date)
expect(subject.keys).to contain_exactly(:id, :title, :description, :author, :state, :iid, :confidential, :created_at, :due_date)
end
end
......@@ -9,7 +9,7 @@ describe EvidenceMilestoneEntity do
subject { entity.as_json }
it 'exposes the expected fields' do
expect(subject.keys).to contain_exactly(:id, :title, :description, :state, :created_at, :due_date, :issues)
expect(subject.keys).to contain_exactly(:id, :title, :description, :state, :iid, :created_at, :due_date, :issues)
end
context 'when there issues linked to this milestone' do
......
......@@ -9,7 +9,7 @@ describe EvidenceReleaseEntity do
subject { entity.as_json }
it 'exposes the expected fields' do
expect(subject.keys).to contain_exactly(:id, :tag, :name, :description, :created_at, :project, :milestones)
expect(subject.keys).to contain_exactly(:id, :tag_name, :name, :description, :created_at, :project, :milestones)
end
context 'when the release has milestones' do
......
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