From 27b75b2b2d9c274fca005949f645d97ce9333d71 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Oct 2015 20:36:22 +0200 Subject: Refactor commit/build tests and fix CI cancel Signed-off-by: Dmitriy Zaporozhets --- spec/features/builds_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 spec/features/builds_spec.rb (limited to 'spec/features/builds_spec.rb') diff --git a/spec/features/builds_spec.rb b/spec/features/builds_spec.rb new file mode 100644 index 00000000000..d0d60491b65 --- /dev/null +++ b/spec/features/builds_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe "Builds" do + + before do + login_as(:user) + @commit = FactoryGirl.create :ci_commit + @build = FactoryGirl.create :ci_build, commit: @commit + @gl_project = @commit.project.gl_project + @gl_project.team << [@user, :master] + end + + describe "GET /:project/builds/:id" do + before do + visit namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + end + + it { expect(page).to have_content @commit.sha[0..7] } + it { expect(page).to have_content @commit.git_commit_message } + it { expect(page).to have_content @commit.git_author_name } + end +end -- cgit v1.2.1 From 1e06cabf4a8fa4d4c7acb9898682a5b4b41a9f58 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Oct 2015 15:24:32 +0200 Subject: Remove Ci::Commit and Ci::Build controllers Signed-off-by: Dmitriy Zaporozhets --- spec/features/builds_spec.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'spec/features/builds_spec.rb') diff --git a/spec/features/builds_spec.rb b/spec/features/builds_spec.rb index d0d60491b65..924047a0d8f 100644 --- a/spec/features/builds_spec.rb +++ b/spec/features/builds_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' describe "Builds" do - before do login_as(:user) @commit = FactoryGirl.create :ci_commit @@ -19,4 +18,24 @@ describe "Builds" do it { expect(page).to have_content @commit.git_commit_message } it { expect(page).to have_content @commit.git_author_name } end + + describe "GET /:project/builds/:id/cancel" do + before do + @build.run! + visit cancel_namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + end + + it { expect(page).to have_content 'canceled' } + it { expect(page).to have_content 'Retry' } + end + + describe "POST /:project/builds/:id/retry" do + before do + visit cancel_namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + click_link 'Retry' + end + + it { expect(page).to have_content 'pending' } + it { expect(page).to have_content 'Cancel' } + end end -- cgit v1.2.1