summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-01-20 21:00:39 -0800
committerStan Hu <stanhu@gmail.com>2018-01-20 21:00:39 -0800
commitb9c537487fdd9782531c6e996d62f8e875f8dab6 (patch)
tree0508865506bbe39b3019386b7cd3b0b05e0601eb /spec/controllers
parentba02e3a5dfb0fb95a1a32b81e893b6fe2ea39b9e (diff)
downloadgitlab-ce-b9c537487fdd9782531c6e996d62f8e875f8dab6.tar.gz
Fix Error 500 when repository has no avatarsh-fix-error-500-no-avatars
Closes #42249
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/avatars_controller_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/controllers/projects/avatars_controller_spec.rb b/spec/controllers/projects/avatars_controller_spec.rb
index 3bbe168f6d5..6a41c4d23ea 100644
--- a/spec/controllers/projects/avatars_controller_spec.rb
+++ b/spec/controllers/projects/avatars_controller_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe Projects::AvatarsController do
- let(:project) { create(:project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
+ let(:project) { create(:project, :repository, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
let(:user) { create(:user) }
before do
@@ -10,6 +10,12 @@ describe Projects::AvatarsController do
controller.instance_variable_set(:@project, project)
end
+ it 'GET #show' do
+ get :show, namespace_id: project.namespace.id, project_id: project.id
+
+ expect(response).to have_gitlab_http_status(404)
+ end
+
it 'removes avatar from DB by calling destroy' do
delete :destroy, namespace_id: project.namespace.id, project_id: project.id
expect(project.avatar.present?).to be_falsey