Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/serializers/container_repository_entity_spec.rb')
-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)