Commit bb23d462 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'fix-500-error-when-rendering-avatar-for-deleted-project-creator' into 'master'

Fix 500 error when rendering avatar for deleted project creator

See merge request !13110
parents 883be9c6 9442c335
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
- if avatar - if avatar
.avatar-container.s40 .avatar-container.s40
= link_to project_path(project), class: dom_class(project) do = link_to project_path(project), class: dom_class(project) do
- if use_creator_avatar - if project.creator && use_creator_avatar
= image_tag avatar_icon(project.creator.email, 40), class: "avatar s40", alt:'' = image_tag avatar_icon(project.creator.email, 40), class: "avatar s40", alt:''
- else - else
= project_icon(project, alt: '', class: 'avatar project-avatar s40') = project_icon(project, alt: '', class: 'avatar project-avatar s40')
......
---
title: Modify if condition to be more readable
merge_request:
author:
require 'spec_helper'
describe 'shared/projects/_project.html.haml' do
let(:project) { create(:empty_project) }
it 'should render creator avatar if project has a creator' do
render 'shared/projects/project', use_creator_avatar: true, project: project
expect(rendered).to have_selector('img.avatar')
end
it 'should render a generic avatar if project does not have a creator' do
project.creator = nil
render 'shared/projects/project', use_creator_avatar: true, project: project
expect(rendered).to have_selector('.project-avatar')
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment