From e5d2a81b86d59c50ff5c488da017a9b56d0442f0 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 5 Jan 2016 12:46:42 +0000 Subject: Add basic spinach tests for project builds --- features/steps/shared/builds.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 features/steps/shared/builds.rb (limited to 'features/steps/shared/builds.rb') diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb new file mode 100644 index 00000000000..6f9cd174729 --- /dev/null +++ b/features/steps/shared/builds.rb @@ -0,0 +1,16 @@ +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 +end -- cgit v1.2.1 From 09c82c6fdc494de0d64cb58b4b61a86104ff1131 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 7 Jan 2016 10:33:07 +0100 Subject: Add spinach feature specs for build artifacts browser --- features/steps/shared/builds.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'features/steps/shared/builds.rb') diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 6f9cd174729..a83d74e5946 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -13,4 +13,16 @@ module SharedBuilds 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 -- cgit v1.2.1