Commit e274ae44 authored by Nathan Friend's avatar Nathan Friend

Customize "Release" page og:description meta tag

This commit updates the dedicated "Release" page to use the release's
description as the og:description meta tag's content instead of the
default (the project's description).
parent bd7f053c
- add_to_breadcrumbs _("Releases"), project_releases_path(@project) - add_to_breadcrumbs _("Releases"), project_releases_path(@project)
- page_title @release.name - page_title @release.name
- page_description @release.description_html
#js-show-release-page{ data: { project_id: @project.id, tag_name: @release.tag } } #js-show-release-page{ data: { project_id: @project.id, tag_name: @release.tag } }
---
title: Add og:description meta tag to individual "Release" page
merge_request: 42889
author:
type: added
...@@ -4,17 +4,25 @@ require 'spec_helper' ...@@ -4,17 +4,25 @@ require 'spec_helper'
RSpec.describe 'User views Release', :js do RSpec.describe 'User views Release', :js do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:release) { create(:release, project: project, name: 'The first release' ) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:release) do
create(:release,
project: project,
name: 'The first release',
description: '**Lorem** _ipsum_ dolor sit [amet](https://example.com)')
end
before do before do
project.add_developer(user) project.add_developer(user)
gitlab_sign_in(user) sign_in(user)
visit project_release_path(project, release) visit project_release_path(project, release)
end end
it_behaves_like 'page meta description', 'Lorem ipsum dolor sit amet'
it 'renders the breadcrumbs' do it 'renders the breadcrumbs' do
within('.breadcrumbs') do within('.breadcrumbs') do
expect(page).to have_content("#{project.creator.name} #{project.name} Releases #{release.name}") expect(page).to have_content("#{project.creator.name} #{project.name} Releases #{release.name}")
...@@ -31,7 +39,7 @@ RSpec.describe 'User views Release', :js do ...@@ -31,7 +39,7 @@ RSpec.describe 'User views Release', :js do
expect(page).to have_content(release.name) expect(page).to have_content(release.name)
expect(page).to have_content(release.tag) expect(page).to have_content(release.tag)
expect(page).to have_content(release.commit.short_id) expect(page).to have_content(release.commit.short_id)
expect(page).to have_content(release.description) expect(page).to have_content('Lorem ipsum dolor sit amet')
end end
end 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