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

54 lines
1.6 KiB
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
require 'spec_helper'
feature 'list of badges' do
background do
user = create(:user)
2017-09-10 17:25:29 +05:30
project = create(:project, :repository)
2016-06-02 11:05:42 +05:30
project.team << [user, :master]
2017-09-10 17:25:29 +05:30
sign_in(user)
visit project_pipelines_settings_path(project)
2016-06-02 11:05:42 +05:30
end
2016-09-13 17:45:13 +05:30
scenario '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'
expect(page).to have_css('.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
page.within('.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
2016-09-13 17:45:13 +05:30
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'
2017-08-17 22:00:37 +05:30
expect(page).to have_content 'AsciiDoc'
expect(page).to have_css('.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
2016-09-13 17:45:13 +05:30
page.within('.highlight', match: :first) do
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
scenario 'user changes current ref of build status badge', js: true 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