debian-mirror-gitlab/spec/features/projects/show/download_buttons_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.3 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2016-09-29 09:46:39 +05:30
require 'spec_helper'
2023-03-04 22:38:38 +05:30
RSpec.describe 'Projects > Show > Download buttons', feature_category: :projects do
2018-11-08 19:23:39 +05:30
let(:user) { create(:user) }
let(:role) { :developer }
let(:status) { 'success' }
let(:project) { create(:project, :repository) }
2016-09-29 09:46:39 +05:30
2018-11-08 19:23:39 +05:30
let(:pipeline) do
2016-09-29 09:46:39 +05:30
create(:ci_pipeline,
project: project,
sha: project.commit.sha,
ref: project.default_branch,
status: status)
end
2018-11-08 19:23:39 +05:30
let!(:build) do
2016-09-29 09:46:39 +05:30
create(:ci_build, :success, :artifacts,
pipeline: pipeline,
status: pipeline.status,
name: 'build')
end
2018-11-08 19:23:39 +05:30
before do
2017-09-10 17:25:29 +05:30
sign_in(user)
2018-03-17 18:26:18 +05:30
project.add_role(user, role)
2016-09-29 09:46:39 +05:30
end
describe 'when checking project main page' do
2019-12-04 20:38:33 +05:30
it_behaves_like 'archive download buttons'
2016-09-29 09:46:39 +05:30
context 'with artifacts' do
before do
2017-09-10 17:25:29 +05:30
visit project_path(project)
2016-09-29 09:46:39 +05:30
end
2018-11-08 19:23:39 +05:30
it 'shows download artifacts button' do
2017-09-10 17:25:29 +05:30
href = latest_succeeded_project_artifacts_path(project, "#{project.default_branch}/download", job: 'build')
2016-09-29 09:46:39 +05:30
2019-07-31 22:56:46 +05:30
expect(page).to have_link build.name, href: href
2016-09-29 09:46:39 +05:30
end
2017-08-17 22:00:37 +05:30
2018-11-08 19:23:39 +05:30
it 'download links have download attribute' do
2017-08-17 22:00:37 +05:30
page.all('a', text: 'Download').each do |link|
expect(link[:download]).to eq ''
end
end
2016-09-29 09:46:39 +05:30
end
end
end