Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-07-28 08:09:40 +0300
committerPaco Guzman <pacoguzmanp@gmail.com>2016-07-29 15:08:41 +0300
commitd05af7b7c6975ae66808ed6676a1b947c7abe244 (patch)
treeb158cf69a40b7806691f877292eb5c94b6f2cae9 /spec
parent41057b856eaf309ba6a80c03fa284dd07e2c73a3 (diff)
Check for Ci::Build artifacts at database level
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/ci/builds.rb16
-rw-r--r--spec/features/pipelines_spec.rb10
2 files changed, 26 insertions, 0 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index 5e19e403c6b..1b32d560b16 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -90,5 +90,21 @@ FactoryGirl.define do
build.save!
end
end
+
+ trait :artifacts_expired do
+ after(:create) do |build, _|
+ build.artifacts_file =
+ fixture_file_upload(Rails.root.join('spec/fixtures/ci_build_artifacts.zip'),
+ 'application/zip')
+
+ build.artifacts_metadata =
+ fixture_file_upload(Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'),
+ 'application/x-gzip')
+
+ build.artifacts_expire_at = 1.minute.ago
+
+ build.save!
+ end
+ end
end
end
diff --git a/spec/features/pipelines_spec.rb b/spec/features/pipelines_spec.rb
index 7f861db1969..377a9aba60d 100644
--- a/spec/features/pipelines_spec.rb
+++ b/spec/features/pipelines_spec.rb
@@ -116,9 +116,19 @@ describe "Pipelines" do
it { expect(page).to have_link(with_artifacts.name) }
end
+ context 'with artifacts expired' do
+ let!(:with_artifacts_expired) { create(:ci_build, :artifacts_expired, :success, pipeline: pipeline, name: 'rspec', stage: 'test') }
+
+ before { visit namespace_project_pipelines_path(project.namespace, project) }
+
+ it { expect(page).not_to have_selector('.build-artifacts') }
+ end
+
context 'without artifacts' do
let!(:without_artifacts) { create(:ci_build, :success, pipeline: pipeline, name: 'rspec', stage: 'test') }
+ before { visit namespace_project_pipelines_path(project.namespace, project) }
+
it { expect(page).not_to have_selector('.build-artifacts') }
end
end