summaryrefslogtreecommitdiff
path: root/spec/features/builds_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-14 12:15:03 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-14 17:28:38 +0200
commita957eca6f364b7587175a6ffa647fc9df80abed9 (patch)
treed3d3eb934a9f2eba028aa611aba421759171d38f /spec/features/builds_spec.rb
parent2d0fcb4de23ab368e2e030b3cf7f6b1705ef676f (diff)
downloadgitlab-ce-a957eca6f364b7587175a6ffa647fc9df80abed9.tar.gz
Added builds view
Diffstat (limited to 'spec/features/builds_spec.rb')
-rw-r--r--spec/features/builds_spec.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/features/builds_spec.rb b/spec/features/builds_spec.rb
index 924047a0d8f..31f8aa83981 100644
--- a/spec/features/builds_spec.rb
+++ b/spec/features/builds_spec.rb
@@ -9,6 +9,55 @@ describe "Builds" do
@gl_project.team << [@user, :master]
end
+ describe "GET /:project/builds" do
+ context "All builds" do
+ before do
+ @build.success
+ visit namespace_project_builds_path(@gl_project.namespace, @gl_project)
+ end
+
+ it { expect(page).to have_content 'All builds' }
+ it { expect(page).to have_content @build.short_sha }
+ it { expect(page).to have_content @build.ref }
+ it { expect(page).to have_content @build.name }
+ it { expect(page).to_not have_content 'Cancel all' }
+ end
+
+ context "Pending scope" do
+ before do
+ @build.success
+ visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :pending)
+ end
+
+ it { expect(page).to have_content 'No builds to show' }
+ it { expect(page).to_not have_content 'Cancel all' }
+ end
+
+ context "Running scope" do
+ before do
+ @build.run!
+ visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :running)
+ end
+
+ it { expect(page).to have_content 'Running' }
+ it { expect(page).to have_content 'Cancel all' }
+ it { expect(page).to have_content @build.short_sha }
+ it { expect(page).to have_content @build.ref }
+ it { expect(page).to have_content @build.name }
+ end
+ end
+
+ describe "POST /:project/builds/:id/cancel_all" do
+ before do
+ @build.run!
+ visit cancel_namespace_project_build_path(@gl_project.namespace, @gl_project, @build)
+ end
+
+ it { expect(page).to have_content 'All builds' }
+ it { expect(page).to have_content 'canceled' }
+ it { expect(page).to_not have_content 'Cancel all' }
+ end
+
describe "GET /:project/builds/:id" do
before do
visit namespace_project_build_path(@gl_project.namespace, @gl_project, @build)