diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 09:06:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 09:06:20 +0300 |
commit | 8e75748aabcbcea411f8bbc68936805bc2b5ff0c (patch) | |
tree | 9186d3e27c66b3680e2039d6769233750c74cc4b /spec/requests/api/snippets_spec.rb | |
parent | 98eaa8d2de5dd751d7a42fa5d601715064f14297 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/snippets_spec.rb')
-rw-r--r-- | spec/requests/api/snippets_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/requests/api/snippets_spec.rb b/spec/requests/api/snippets_spec.rb index 36d2a0d7ea7..29ef040ee2e 100644 --- a/spec/requests/api/snippets_spec.rb +++ b/spec/requests/api/snippets_spec.rb @@ -66,6 +66,9 @@ describe API::Snippets do let!(:public_snippet_other) { create(:personal_snippet, :public, author: other_user) } let!(:private_snippet_other) { create(:personal_snippet, :private, author: other_user) } let!(:internal_snippet_other) { create(:personal_snippet, :internal, author: other_user) } + let!(:public_snippet_project) { create(:project_snippet, :public, author: user) } + let!(:private_snippet_project) { create(:project_snippet, :private, author: user) } + let!(:internal_snippet_project) { create(:project_snippet, :internal, author: user) } it 'returns all snippets with public visibility from all users' do get api("/snippets/public", user) @@ -76,10 +79,10 @@ describe API::Snippets do expect(json_response.map { |snippet| snippet['id']} ).to contain_exactly( public_snippet.id, public_snippet_other.id) - expect(json_response.map { |snippet| snippet['web_url']} ).to include( + expect(json_response.map { |snippet| snippet['web_url']} ).to contain_exactly( "http://localhost/snippets/#{public_snippet.id}", "http://localhost/snippets/#{public_snippet_other.id}") - expect(json_response.map { |snippet| snippet['raw_url']} ).to include( + expect(json_response.map { |snippet| snippet['raw_url']} ).to contain_exactly( "http://localhost/snippets/#{public_snippet.id}/raw", "http://localhost/snippets/#{public_snippet_other.id}/raw") end |