debian-mirror-gitlab/spec/features/projects/show/schema_markup_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
1.1 KiB
Ruby
Raw Normal View History

2021-01-29 00:20:46 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-03-04 22:38:38 +05:30
RSpec.describe 'Projects > Show > Schema Markup', feature_category: :projects do
2021-09-04 01:27:46 +05:30
let_it_be(:project) { create(:project, :repository, :public, :with_avatar, description: 'foobar', topic_list: 'topic1, topic2') }
2021-01-29 00:20:46 +05:30
it 'shows SoftwareSourceCode structured markup', :js do
visit project_path(project)
wait_for_all_requests
aggregate_failures do
expect(page).to have_selector('[itemscope][itemtype="http://schema.org/SoftwareSourceCode"]')
expect(page).to have_selector('img[itemprop="image"]')
expect(page).to have_selector('[itemprop="name"]', text: project.name)
expect(page).to have_selector('[itemprop="identifier"]', text: "Project ID: #{project.id}")
2021-02-22 17:27:13 +05:30
expect(page).to have_selector('[itemprop="description"]', text: project.description)
2021-01-29 00:20:46 +05:30
expect(page).to have_selector('[itemprop="license"]', text: project.repository.license.name)
2021-10-27 15:23:28 +05:30
expect(find_all('[itemprop="keywords"]').map(&:text)).to match_array(project.topic_list)
2021-01-29 00:20:46 +05:30
expect(page).to have_selector('[itemprop="about"]')
end
end
end