summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 12:07:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 12:07:33 +0000
commit6b75320f525f841454f1ab162d141d3610f2e77b (patch)
tree4971c27759e4fbc18b85e71800c3b9c12346317e /spec/serializers
parent4226aca420920c1844e8eade4798a2dff188a6fc (diff)
downloadgitlab-ce-6b75320f525f841454f1ab162d141d3610f2e77b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/container_repository_entity_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/serializers/container_repository_entity_spec.rb b/spec/serializers/container_repository_entity_spec.rb
index 5848dd64c3b..799a8d5c122 100644
--- a/spec/serializers/container_repository_entity_spec.rb
+++ b/spec/serializers/container_repository_entity_spec.rb
@@ -25,6 +25,18 @@ describe ContainerRepositoryEntity do
expect(subject).to include(:id, :path, :location, :tags_path)
end
+ context 'when project is not preset in the request' do
+ before do
+ allow(request).to receive(:respond_to?).and_return(false)
+ allow(request).to receive(:project).and_return(nil)
+ end
+
+ it 'uses project from the object' do
+ expect(request.project).not_to equal(project)
+ expect(subject).to include(:tags_path)
+ end
+ end
+
context 'when user can manage repositories' do
before do
project.add_developer(user)