gitlab-org--gitlab-foss/spec/features/projects/badges/list_spec.rb
Jan Christophersen 95ed01749e Add AsciiDoc snippet for CI/CD Badges
This commit adds CI/CD Badges Snippets for AsciiDoc as requested in #26087.
I've however run into an issue in highlighting the snippet, it seems as if AsciiDoc is currently not being highlighted properly (displayed as plaintext)

Add testcase for to_asciidoc

Update test case for Badges list
2017-02-20 16:37:44 +01:00

53 lines
1.6 KiB
Ruby

require 'spec_helper'
feature 'list of badges' do
background do
user = create(:user)
project = create(:project)
project.team << [user, :master]
login_as(user)
visit namespace_project_pipelines_settings_path(project.namespace, project)
end
scenario 'user wants to see build status badge' do
page.within('.build-status') do
expect(page).to have_content 'build status'
expect(page).to have_content 'Markdown'
expect(page).to have_content 'HTML'
expect(page).to have_content 'AsciiDoc'
expect(page).to have_css('.highlight', count: 3)
expect(page).to have_xpath("//img[@alt='build status']")
page.within('.highlight', match: :first) do
expect(page).to have_content 'badges/master/build.svg'
end
end
end
scenario 'user wants to see coverage report badge' do
page.within('.coverage-report') do
expect(page).to have_content 'coverage report'
expect(page).to have_content 'Markdown'
expect(page).to have_content 'HTML'
expect(page).to have_content 'AsciiDoc'
expect(page).to have_css('.highlight', count: 3)
expect(page).to have_xpath("//img[@alt='coverage report']")
page.within('.highlight', match: :first) do
expect(page).to have_content 'badges/master/coverage.svg'
end
end
end
scenario 'user changes current ref of build status badge', js: true do
page.within('.build-status') do
first('.js-project-refs-dropdown').click
page.within '.project-refs-form' do
click_link 'improve/awesome'
end
expect(page).to have_content 'badges/improve/awesome/build.svg'
end
end
end