Commit 9604f123 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Conforming the style

parent d0451a05
...@@ -2,27 +2,33 @@ require 'spec_helper' ...@@ -2,27 +2,33 @@ require 'spec_helper'
describe 'Artifacts' do describe 'Artifacts' do
let(:artifacts_file) { fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') } 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 before do
login_as(:user) login_as(:user)
@commit = FactoryGirl.create :ci_pipeline project.team << [@user, :developer]
@build = FactoryGirl.create :ci_build, pipeline: @commit
@build2 = FactoryGirl.create :ci_build
@project = @commit.project
@project.team << [@user, :developer]
end end
describe "GET /:project/builds/:id/artifacts/download" do describe 'GET /:project/builds/:id/artifacts/download' do
before do before do
@build.update_attributes(artifacts_file: artifacts_file) build.update_attributes(artifacts_file: artifacts_file)
visit namespace_project_build_path(@project.namespace, @project, @build)
visit namespace_project_build_path(project.namespace, project, build)
click_link 'Download' click_link 'Download'
end end
context "Build from other project" do context 'Build from other project' do
before do before do
@build2.update_attributes(artifacts_file: artifacts_file) build2.update_attributes(artifacts_file: artifacts_file)
visit download_namespace_project_build_artifacts_path(@project.namespace, @project, @build2)
visit download_namespace_project_build_artifacts_path(
project.namespace,
project,
build2)
end end
it { expect(page.status_code).to eq(404) } it { expect(page.status_code).to eq(404) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment