summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-03-09 13:25:39 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-03-09 16:56:42 -0500
commitbefa7a9c170327ecc4ce698f416450dc3542942c (patch)
treefd5ae265e04637b2d82ebb6ffc0f678b2de5edb6 /spec/requests
parentd9042e8b399608fa189ffdb02efa8de30604088d (diff)
downloadgitlab-ce-befa7a9c170327ecc4ce698f416450dc3542942c.tar.gz
Don't remove `ProjectSnippet#expires_at` from APIrs-snippet-expires-api
See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3103 This partially reverts commit 836d5930332797192094ce4a3c8083e96f7e8c53.
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/project_snippets_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/requests/api/project_snippets_spec.rb b/spec/requests/api/project_snippets_spec.rb
new file mode 100644
index 00000000000..3722ddf5a33
--- /dev/null
+++ b/spec/requests/api/project_snippets_spec.rb
@@ -0,0 +1,18 @@
+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