summaryrefslogtreecommitdiff
path: root/features/steps/shared/builds.rb
diff options
context:
space:
mode:
authorAndriy Dyadyura <adyadyura@Andriys-MBP.lan>2016-01-14 15:54:15 +0100
committerAndriy Dyadyura <adyadyura@Andriys-MBP.lan>2016-01-14 15:54:15 +0100
commit3102575316e6eac937eb865346e0d78935c37362 (patch)
tree5434a52528390e18ac68ff705f19f8441a952f57 /features/steps/shared/builds.rb
parente29ce9ac267e6724945b9558d069dda2b2ec2755 (diff)
parentb6ae2def2cb2b1da3ddcb3ceee556628a1147cc4 (diff)
downloadgitlab-ce-pr-page-fix1.tar.gz
Diffstat (limited to 'features/steps/shared/builds.rb')
-rw-r--r--features/steps/shared/builds.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb
new file mode 100644
index 00000000000..a83d74e5946
--- /dev/null
+++ b/features/steps/shared/builds.rb
@@ -0,0 +1,28 @@
+module SharedBuilds
+ include Spinach::DSL
+
+ step 'CI is enabled' do
+ @project.enable_ci
+ end
+
+ step 'I have recent build for my project' do
+ ci_commit = create :ci_commit, project: @project, sha: sample_commit.id
+ @build = create :ci_build, commit: ci_commit
+ end
+
+ step 'I visit recent build summary page' do
+ visit namespace_project_build_path(@project.namespace, @project, @build)
+ end
+
+ step 'recent build has artifacts available' do
+ artifacts = Rails.root + 'spec/fixtures/ci_build_artifacts.zip'
+ archive = fixture_file_upload(artifacts, 'application/zip')
+ @build.update_attributes(artifacts_file: archive)
+ end
+
+ step 'recent build has artifacts metadata available' do
+ metadata = Rails.root + 'spec/fixtures/ci_build_artifacts_metadata.gz'
+ gzip = fixture_file_upload(metadata, 'application/x-gzip')
+ @build.update_attributes(artifacts_metadata: gzip)
+ end
+end