diff options
author | Han Loong Liauw <hanloongliauw@gmail.com> | 2015-10-17 09:32:31 +1100 |
---|---|---|
committer | Han Loong Liauw <hanloongliauw@gmail.com> | 2015-10-17 09:32:31 +1100 |
commit | 02e8beaa0b83a343752ebf60e4fca4482c17f9e3 (patch) | |
tree | e00847b274daa7fa03fd7a4647154cc2e4d98e85 /spec/features | |
parent | 0bea5ced8bf4c9306f8f8e912313731a43d16f4c (diff) | |
parent | c856a7a5934fba13598be09507c2090888f57a39 (diff) | |
download | gitlab-ce-02e8beaa0b83a343752ebf60e4fca4482c17f9e3.tar.gz |
Merge branch 'master' into remove-forks-from-projects-settings
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/builds_spec.rb | 48 | ||||
-rw-r--r-- | spec/features/commits_spec.rb | 11 |
2 files changed, 58 insertions, 1 deletions
diff --git a/spec/features/builds_spec.rb b/spec/features/builds_spec.rb index 924047a0d8f..154857e77fe 100644 --- a/spec/features/builds_spec.rb +++ b/spec/features/builds_spec.rb @@ -9,6 +9,54 @@ describe "Builds" do @gl_project.team << [@user, :master] end + describe "GET /:project/builds" do + context "Running scope" do + before do + @build.run! + visit namespace_project_builds_path(@gl_project.namespace, @gl_project) + 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 + + context "Finished scope" do + before do + @build.run! + visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :finished) + end + + it { expect(page).to have_content 'No builds to show' } + it { expect(page).to have_content 'Cancel all' } + end + + context "All builds" do + before do + @gl_project.ci_builds.running_or_pending.each(&:success) + visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :all) + end + + it { expect(page).to have_content '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 } + it { expect(page).to_not have_content 'Cancel all' } + end + end + + describe "GET /:project/builds/:id/cancel_all" do + before do + @build.run! + visit cancel_all_namespace_project_builds_path(@gl_project.namespace, @gl_project) + end + + it { expect(page).to have_content 'No builds to show' } + 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) diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index 5da220859e3..1adc2cdf70a 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -12,6 +12,7 @@ describe "Commits" do @ci_project = project.ensure_gitlab_ci_project @commit = FactoryGirl.create :ci_commit, gl_project: project, sha: project.commit.sha @build = FactoryGirl.create :ci_build, commit: @commit + @generic_status = FactoryGirl.create :generic_commit_status, commit: @commit end before do @@ -28,9 +29,17 @@ describe "Commits" do it { expect(page).to have_content @commit.git_author_name } end - describe "Cancel commit" do + describe "Cancel all builds" do it "cancels commit" do visit ci_status_path(@commit) + click_on "Cancel all" + expect(page).to have_content "canceled" + end + end + + describe "Cancel build" do + it "cancels build" do + visit ci_status_path(@commit) click_on "Cancel" expect(page).to have_content "canceled" end |