debian-mirror-gitlab/spec/features/projects/badges/list_spec.rb

56 lines
1.7 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2016-06-02 11:05:42 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'list of badges' do
2018-11-08 19:23:39 +05:30
before do
2016-06-02 11:05:42 +05:30
user = create(:user)
2017-09-10 17:25:29 +05:30
project = create(:project, :repository)
2018-11-18 11:00:15 +05:30
project.add_maintainer(user)
2017-09-10 17:25:29 +05:30
sign_in(user)
2018-05-09 12:01:36 +05:30
visit project_settings_ci_cd_path(project)
2016-06-02 11:05:42 +05:30
end
2018-11-08 19:23:39 +05:30
it 'user wants to see build status badge' do
2017-09-10 17:25:29 +05:30
page.within('.pipeline-status') do
expect(page).to have_content 'pipeline status'
2016-09-13 17:45:13 +05:30
expect(page).to have_content 'Markdown'
expect(page).to have_content 'HTML'
2017-08-17 22:00:37 +05:30
expect(page).to have_content 'AsciiDoc'
2021-01-03 14:25:43 +05:30
expect(page).to have_css('.js-syntax-highlight', count: 3)
2017-09-10 17:25:29 +05:30
expect(page).to have_xpath("//img[@alt='pipeline status']")
2016-09-13 17:45:13 +05:30
2021-01-03 14:25:43 +05:30
page.within('.js-syntax-highlight', match: :first) do
2017-09-10 17:25:29 +05:30
expect(page).to have_content 'badges/master/pipeline.svg'
2016-09-13 17:45:13 +05:30
end
2016-06-02 11:05:42 +05:30
end
end
2018-11-08 19:23:39 +05:30
it 'user wants to see coverage report badge' do
2016-09-13 17:45:13 +05:30
page.within('.coverage-report') do
expect(page).to have_content 'coverage report'
expect(page).to have_content 'Markdown'
expect(page).to have_content 'HTML'
2017-08-17 22:00:37 +05:30
expect(page).to have_content 'AsciiDoc'
2021-01-03 14:25:43 +05:30
expect(page).to have_css('.js-syntax-highlight', count: 3)
2016-09-13 17:45:13 +05:30
expect(page).to have_xpath("//img[@alt='coverage report']")
2016-06-22 15:30:34 +05:30
2021-01-03 14:25:43 +05:30
page.within('.js-syntax-highlight', match: :first) do
2016-09-13 17:45:13 +05:30
expect(page).to have_content 'badges/master/coverage.svg'
end
2016-06-22 15:30:34 +05:30
end
2016-09-13 17:45:13 +05:30
end
2018-11-08 19:23:39 +05:30
it 'user changes current ref of build status badge', :js do
2017-09-10 17:25:29 +05:30
page.within('.pipeline-status') do
2016-09-13 17:45:13 +05:30
first('.js-project-refs-dropdown').click
2016-06-02 11:05:42 +05:30
2016-09-13 17:45:13 +05:30
page.within '.project-refs-form' do
click_link 'improve/awesome'
end
2017-09-10 17:25:29 +05:30
expect(page).to have_content 'badges/improve/awesome/pipeline.svg'
2016-09-13 17:45:13 +05:30
end
2016-06-02 11:05:42 +05:30
end
end