summaryrefslogtreecommitdiff
path: root/spec/features/projects/files/download_buttons_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/files/download_buttons_spec.rb')
-rw-r--r--spec/features/projects/files/download_buttons_spec.rb34
1 files changed, 14 insertions, 20 deletions
diff --git a/spec/features/projects/files/download_buttons_spec.rb b/spec/features/projects/files/download_buttons_spec.rb
index 2101627f324..03cb3530e2b 100644
--- a/spec/features/projects/files/download_buttons_spec.rb
+++ b/spec/features/projects/files/download_buttons_spec.rb
@@ -1,42 +1,36 @@
require 'spec_helper'
-feature 'Download buttons in files tree' do
- given(:user) { create(:user) }
- given(:role) { :developer }
- given(:status) { 'success' }
- given(:project) { create(:project, :repository) }
+describe 'Projects > Files > Download buttons in files tree' do
+ let(:project) { create(:project, :repository) }
+ let(:user) { project.creator }
- given(:pipeline) do
+ let(:pipeline) do
create(:ci_pipeline,
project: project,
sha: project.commit.sha,
ref: project.default_branch,
- status: status)
+ status: 'success')
end
- given!(:build) do
+ let!(:build) do
create(:ci_build, :success, :artifacts,
pipeline: pipeline,
status: pipeline.status,
name: 'build')
end
- background do
+ before do
sign_in(user)
- project.add_role(user, role)
- end
+ project.add_developer(user)
- describe 'when files tree' do
- context 'with artifacts' do
- before do
- visit project_tree_path(project, project.default_branch)
- end
+ visit project_tree_path(project, project.default_branch)
+ end
- scenario 'shows download artifacts button' do
- href = latest_succeeded_project_artifacts_path(project, "#{project.default_branch}/download", job: 'build')
+ context 'with artifacts' do
+ it 'shows download artifacts button' do
+ href = latest_succeeded_project_artifacts_path(project, "#{project.default_branch}/download", job: 'build')
- expect(page).to have_link "Download '#{build.name}'", href: href
- end
+ expect(page).to have_link "Download '#{build.name}'", href: href
end
end
end