BigW Consortium Gitlab

Commit 1421fa96 by Robert Speicher

Merge branch 'rs-snippet-expires-api' into 'master'

Don't remove `ProjectSnippet#expires_at` from API See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3103 This partially reverts commit 836d5930. See merge request !3144
parents 9c364304 befa7a9c
......@@ -145,6 +145,7 @@ Parameters:
"state": "active",
"created_at": "2013-09-30T13:46:01Z"
},
"expires_at": null,
"updated_at": "2013-10-02T07:34:20Z",
"created_at": "2013-10-02T07:34:20Z"
}
......
......@@ -51,6 +51,7 @@ Parameters:
"state": "active",
"created_at": "2012-05-23T08:00:58Z"
},
"expires_at": null,
"updated_at": "2012-06-28T10:52:04Z",
"created_at": "2012-06-28T10:52:04Z"
}
......
......@@ -582,6 +582,7 @@ X-Gitlab-Event: Note Hook
"created_at": "2015-04-09 02:40:38 UTC",
"updated_at": "2015-04-09 02:40:38 UTC",
"file_name": "test.rb",
"expires_at": null,
"type": "ProjectSnippet",
"visibility_level": 0
}
......
......@@ -144,6 +144,9 @@ module API
expose :id, :title, :file_name
expose :author, using: Entities::UserBasic
expose :updated_at, :created_at
# TODO (rspeicher): Deprecated; remove in 9.0
expose(:expires_at) { |snippet| nil }
end
class ProjectEntity < Grape::Entity
......
require 'rails_helper'
describe API::API, api: true do
include ApiHelpers
describe 'GET /projects/:project_id/snippets/:id' do
# TODO (rspeicher): Deprecated; remove in 9.0
it 'always exposes expires_at as nil' do
admin = create(:admin)
snippet = create(:project_snippet, author: admin)
get api("/projects/#{snippet.project.id}/snippets/#{snippet.id}", admin)
expect(json_response).to have_key('expires_at')
expect(json_response['expires_at']).to be_nil
end
end
end
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