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

52 lines
1.5 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)
project = create(:project)
project.team << [user, :master]
login_as(user)
2016-08-24 12:49:21 +05:30
visit namespace_project_pipelines_settings_path(project.namespace, 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
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_css('.highlight', count: 2)
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
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'
expect(page).to have_css('.highlight', count: 2)
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
page.within('.build-status') do
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
expect(page).to have_content 'badges/improve/awesome/build.svg'
end
2016-06-02 11:05:42 +05:30
end
end