Commit 54f891a1 authored by Phil Hughes's avatar Phil Hughes Committed by Kushal Pandya

Fixes user profile 500 error

parent 7e5c3d65
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
%a.js-retry-load{ href: '#' } %a.js-retry-load{ href: '#' }
= s_('UserProfile|Retry') = s_('UserProfile|Retry')
.user-calendar-activities .user-calendar-activities
- if @user.user_readme - if @user.user_readme&.rich_viewer
.row.justify-content-center .row.justify-content-center
.col-12.col-md-10.col-lg-8.gl-my-6 .col-12.col-md-10.col-lg-8.gl-my-6
.gl-display-flex .gl-display-flex
......
...@@ -29,6 +29,24 @@ RSpec.describe 'User visits their profile' do ...@@ -29,6 +29,24 @@ RSpec.describe 'User visits their profile' do
expect(find('.file-content')).to have_content('testme') expect(find('.file-content')).to have_content('testme')
end end
it 'hides empty user readme' do
project = create(:project, :repository, :public, path: user.username, namespace: user.namespace)
Files::UpdateService.new(
project,
user,
start_branch: 'master',
branch_name: 'master',
commit_message: 'Update feature',
file_path: 'README.md',
file_content: ''
).execute
visit(user_path(user))
expect(page).not_to have_selector('.file-content')
end
context 'when user has groups' do context 'when user has groups' do
let(:group) do let(:group) do
create :group do |group| create :group do |group|
......
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