diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-11 12:52:56 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-11 12:52:56 +0200 |
| commit | a8dd4d36e2ba2bcf2488ce12aa0809c339653fc8 (patch) | |
| tree | 96ddb306cc83f0916c118a2a02f059342a2cba60 /spec/features/ci | |
| parent | 9a9417ee8e8f3d8fe8320eaaf150ff1eb77a471e (diff) | |
| download | gitlab-ce-a8dd4d36e2ba2bcf2488ce12aa0809c339653fc8.tar.gz | |
Fix build features specs
Diffstat (limited to 'spec/features/ci')
| -rw-r--r-- | spec/features/ci/builds_spec.rb | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/spec/features/ci/builds_spec.rb b/spec/features/ci/builds_spec.rb index ddfc579d1b8..2f020e524e2 100644 --- a/spec/features/ci/builds_spec.rb +++ b/spec/features/ci/builds_spec.rb @@ -1,57 +1,60 @@ require 'spec_helper' describe "Builds" do - before do - @project = FactoryGirl.create :project - @commit = FactoryGirl.create :commit, project: @project - @build = FactoryGirl.create :build, commit: @commit - end - - describe "GET /:project/builds/:id" do + context :private_project do before do + @project = FactoryGirl.create :ci_project + @commit = FactoryGirl.create :ci_commit, project: @project + @build = FactoryGirl.create :ci_build, commit: @commit login_as :user - visit project_build_path(@project, @build) + @project.gl_project.team << [@user, :master] 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 + describe "GET /:project/builds/:id" do + before do + visit ci_project_build_path(@project, @build) + end - describe "GET /:project/builds/:id/cancel" do - before do - login_as :user - @build.run! - visit cancel_project_build_path(@project, @build) + 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 - it { expect(page).to have_content 'canceled' } - it { expect(page).to have_content 'Retry' } - end + describe "GET /:project/builds/:id/cancel" do + before do + @build.run! + visit cancel_ci_project_build_path(@project, @build) + end - describe "POST /:project/builds/:id/retry" do - before do - login_as :user - @build.cancel! - visit project_build_path(@project, @build) - click_link 'Retry' + it { expect(page).to have_content 'canceled' } + it { expect(page).to have_content 'Retry' } end - it { expect(page).to have_content 'pending' } - it { expect(page).to have_content 'Cancel' } + describe "POST /:project/builds/:id/retry" do + before do + @build.cancel! + visit ci_project_build_path(@project, @build) + click_link 'Retry' + end + + it { expect(page).to have_content 'pending' } + it { expect(page).to have_content 'Cancel' } + end end - describe "Show page public accessible" do - before do - @project = FactoryGirl.create :public_project - @commit = FactoryGirl.create :commit, project: @project - @runner = FactoryGirl.create :specific_runner - @build = FactoryGirl.create :build, commit: @commit, runner: @runner + context :public_project do + describe "Show page public accessible" do + before do + @project = FactoryGirl.create :ci_public_project + @commit = FactoryGirl.create :ci_commit, project: @project + @runner = FactoryGirl.create :ci_specific_runner + @build = FactoryGirl.create :ci_build, commit: @commit, runner: @runner - stub_gitlab_calls - visit project_build_path(@project, @build) - end + stub_gitlab_calls + visit ci_project_build_path(@project, @build) + end - it { expect(page).to have_content @commit.sha[0..7] } + it { expect(page).to have_content @commit.sha[0..7] } + end end end |
