Commit fafe1608 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '214283-add-updated-at-to-todos-api' into 'master'

Add updated_at to todos API

Closes #214283

See merge request gitlab-org/gitlab!30035
parents 41b12652 c6f2abc9
---
title: Expose the updated_at attribute in the todos API
merge_request: 30035
author:
type: changed
...@@ -101,7 +101,8 @@ Example Response: ...@@ -101,7 +101,8 @@ Example Response:
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7", "target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.", "body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
"state": "pending", "state": "pending",
"created_at": "2016-06-17T07:52:35.225Z" "created_at": "2016-06-17T07:52:35.225Z",
"updated_at": "2016-06-17T07:52:35.225Z"
}, },
{ {
"id": 98, "id": 98,
...@@ -174,7 +175,8 @@ Example Response: ...@@ -174,7 +175,8 @@ Example Response:
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7", "target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.", "body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
"state": "pending", "state": "pending",
"created_at": "2016-06-17T07:49:24.624Z" "created_at": "2016-06-17T07:49:24.624Z",
"updated_at": "2016-06-17T07:49:24.624Z"
} }
] ]
``` ```
...@@ -272,7 +274,8 @@ Example Response: ...@@ -272,7 +274,8 @@ Example Response:
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7", "target_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/merge_requests/7",
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.", "body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
"state": "done", "state": "done",
"created_at": "2016-06-17T07:52:35.225Z" "created_at": "2016-06-17T07:52:35.225Z",
"updated_at": "2016-06-17T07:52:35.225Z"
} }
``` ```
......
...@@ -22,6 +22,7 @@ module API ...@@ -22,6 +22,7 @@ module API
expose :body expose :body
expose :state expose :state
expose :created_at expose :created_at
expose :updated_at
def todo_target_class(target_type) def todo_target_class(target_type)
# false as second argument prevents looking up in module hierarchy # false as second argument prevents looking up in module hierarchy
......
...@@ -235,6 +235,7 @@ describe API::Todos do ...@@ -235,6 +235,7 @@ describe API::Todos do
expect(json_response['state']).to eq('pending') expect(json_response['state']).to eq('pending')
expect(json_response['action_name']).to eq('marked') expect(json_response['action_name']).to eq('marked')
expect(json_response['created_at']).to be_present expect(json_response['created_at']).to be_present
expect(json_response['updated_at']).to be_present
end end
it 'returns 304 there already exist a todo on that issuable' do it 'returns 304 there already exist a todo on that issuable' 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