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
path: root/spec
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2016-10-11 21:13:42 +0300
committerSean McGivern <sean@mcgivern.me.uk>2016-10-11 21:13:42 +0300
commit3d253e5cb3b9ccfe88ef97607399ff6fa7b7a48d (patch)
tree480e91db3c3b8c5d6d12df223a30a5ba7f1552b3 /spec
parentd57d892e3fd4d73a477ba5c1b0049864f7c9e6b2 (diff)
parentd0c240b64fbb5f723a630fe96af380a9c82fd1b1 (diff)
Merge branch '22211-500-instead-of-404' into 'master'
Respond with 404 Not Found for non-existent tags ## What does this MR do? Handles the case when a non-existent tag is being viewed, and responds with 404 Not Found instead of 500 Internal Server Error. ## Are there points in the code the reviewer needs to double check? The small changes should be clear from a simple diff. ## Why was this MR needed? To resolve the issue #22211. ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #22211 See merge request !6699
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects/tags_controller_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/projects/tags_controller_spec.rb b/spec/controllers/projects/tags_controller_spec.rb
index a6995145cc1..5e661c2c41d 100644
--- a/spec/controllers/projects/tags_controller_spec.rb
+++ b/spec/controllers/projects/tags_controller_spec.rb
@@ -17,4 +17,18 @@ describe Projects::TagsController do
expect(assigns(:releases)).not_to include(invalid_release)
end
end
+
+ describe 'GET show' do
+ before { get :show, namespace_id: project.namespace.to_param, project_id: project.to_param, id: id }
+
+ context "valid tag" do
+ let(:id) { 'v1.0.0' }
+ it { is_expected.to respond_with(:success) }
+ end
+
+ context "invalid tag" do
+ let(:id) { 'latest' }
+ it { is_expected.to respond_with(:not_found) }
+ end
+ end
end