diff options
author | Robert Speicher <robert@gitlab.com> | 2016-03-14 18:55:05 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-03-14 18:55:05 +0300 |
commit | 1421fa962ef9aaae6b5756054644606f3543ccce (patch) | |
tree | e20f0a7fa7310b164d45b6df3a809e8dec8ad12a /spec | |
parent | 9c3643046b40e66a7754aabe2513ccdee292a4ef (diff) | |
parent | befa7a9c170327ecc4ce698f416450dc3542942c (diff) |
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 836d5930332797192094ce4a3c8083e96f7e8c53.
See merge request !3144
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/project_snippets_spec.rb | 18 |
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 |