Commit 9d8d82ec authored by Peter Hegman's avatar Peter Hegman

Merge branch 'dblessing_unconfirmed_blocked_bio_metadata' into 'master'

Only display user bio for confirmed and active users

See merge request gitlab-org/gitlab!75032
parents bbf96ce6 f2d07667
......@@ -2,8 +2,7 @@
- @hide_breadcrumbs = true
- @no_container = true
- page_title user_display_name(@user)
- page_description @user.bio
- header_title @user.name, user_path(@user)
- page_description @user.bio unless @user.blocked? || !@user.confirmed?
- page_itemtype 'http://schema.org/Person'
- link_classes = "flex-grow-1 mx-1 "
......
......@@ -207,34 +207,31 @@ RSpec.describe 'User page' do
state: :blocked,
organization: 'GitLab - work info test',
job_title: 'Frontend Engineer',
pronunciation: 'pruh-nuhn-see-ay-shn'
pronunciation: 'pruh-nuhn-see-ay-shn',
bio: 'My personal bio'
)
end
let_it_be(:status) { create(:user_status, user: user, message: "Working hard!") }
it 'shows no tab' do
subject
before do
visit_profile
end
it 'shows no tab' do
expect(page).to have_css("div.profile-header")
expect(page).not_to have_css("ul.nav-links")
end
it 'shows blocked message' do
subject
expect(page).to have_content("This user is blocked")
end
it 'shows user name as blocked' do
subject
expect(page).to have_css(".cover-title", text: 'Blocked user')
end
it 'shows no additional fields' do
subject
expect(page).not_to have_css(".profile-user-bio")
expect(page).not_to have_content('GitLab - work info test')
expect(page).not_to have_content('Frontend Engineer')
......@@ -243,10 +240,10 @@ RSpec.describe 'User page' do
end
it 'shows username' do
subject
expect(page).to have_content("@#{user.username}")
end
it_behaves_like 'default brand title page meta description'
end
context 'with unconfirmed user' do
......@@ -256,7 +253,8 @@ RSpec.describe 'User page' do
:unconfirmed,
organization: 'GitLab - work info test',
job_title: 'Frontend Engineer',
pronunciation: 'pruh-nuhn-see-ay-shn'
pronunciation: 'pruh-nuhn-see-ay-shn',
bio: 'My personal bio'
)
end
......@@ -287,6 +285,8 @@ RSpec.describe 'User page' do
it 'shows private profile message' do
expect(page).to have_content("This user has a private profile")
end
it_behaves_like 'default brand title page meta description'
end
context 'when visited by an authenticated user' do
......
......@@ -7,3 +7,13 @@ RSpec.shared_examples 'page meta description' do |expected_description|
end
end
end
RSpec.shared_examples 'default brand title page meta description' do
include AppearancesHelper
it 'renders the page with description, og:description, and twitter:description meta tags with the default brand title', :aggregate_failures do
%w(name='description' property='og:description' property='twitter:description').each do |selector|
expect(page).to have_selector("meta[#{selector}][content='#{default_brand_title}']", visible: false)
end
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