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)
|
2018-03-17 18:26:18 +05:30
|
|
|
project.add_master(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
|
|
|
|
|
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
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
scenario '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
|