From 9604f12331ab0ce3a14b1780cc1245eb8df33038 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin <godfat@godfat.org> Date: Tue, 12 Jul 2016 19:14:44 +0800 Subject: [PATCH] Conforming the style --- spec/features/projects/artifacts_spec.rb | 28 ++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/spec/features/projects/artifacts_spec.rb b/spec/features/projects/artifacts_spec.rb index fc6e2b07d40..5e60c2f3074 100644 --- a/spec/features/projects/artifacts_spec.rb +++ b/spec/features/projects/artifacts_spec.rb @@ -2,27 +2,33 @@ require 'spec_helper' describe 'Artifacts' do let(:artifacts_file) { fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') } + let(:pipeline) { create(:ci_pipeline) } + let(:build) { create(:ci_build, pipeline: pipeline) } + let(:build2) { create(:ci_build) } + let(:project) { pipeline.project } before do login_as(:user) - @commit = FactoryGirl.create :ci_pipeline - @build = FactoryGirl.create :ci_build, pipeline: @commit - @build2 = FactoryGirl.create :ci_build - @project = @commit.project - @project.team << [@user, :developer] + project.team << [@user, :developer] end - describe "GET /:project/builds/:id/artifacts/download" do + describe 'GET /:project/builds/:id/artifacts/download' do before do - @build.update_attributes(artifacts_file: artifacts_file) - visit namespace_project_build_path(@project.namespace, @project, @build) + build.update_attributes(artifacts_file: artifacts_file) + + visit namespace_project_build_path(project.namespace, project, build) + click_link 'Download' end - context "Build from other project" do + context 'Build from other project' do before do - @build2.update_attributes(artifacts_file: artifacts_file) - visit download_namespace_project_build_artifacts_path(@project.namespace, @project, @build2) + build2.update_attributes(artifacts_file: artifacts_file) + + visit download_namespace_project_build_artifacts_path( + project.namespace, + project, + build2) end it { expect(page.status_code).to eq(404) } -- GitLab