diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-22 15:21:45 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-22 15:21:45 +0900 |
commit | 8e92e25b62ca108de775362e6d2981e54535f094 (patch) | |
tree | de8f581c21dfe30d3ed3024ee42d2207165bcd8b /spec | |
parent | f61666c0d70ed2d8457e4a8d8d23e68816498035 (diff) | |
download | gitlab-ce-8e92e25b62ca108de775362e6d2981e54535f094.tar.gz |
Remvoe disable_ddl_transaction! and redandant RecordNotUnique exception rescue
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/chain/create_spec.rb | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb index 9c0bedfb6b7..de69a65aee4 100644 --- a/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb @@ -37,17 +37,6 @@ describe Gitlab::Ci::Pipeline::Chain::Create do end context 'when pipeline has validation errors' do - shared_examples_for 'expectations' do - it 'breaks the chain' do - expect(step.break?).to be true - end - - it 'appends validation error' do - expect(pipeline.errors.to_a) - .to include /Failed to persist the pipeline/ - end - end - context 'when ref is nil' do let(:pipeline) do build(:ci_pipeline, project: project, ref: nil) @@ -57,18 +46,14 @@ describe Gitlab::Ci::Pipeline::Chain::Create do step.perform! end - it_behaves_like 'expectations' - end - - context 'when pipeline has a duplicate iid' do - before do - allow_any_instance_of(Ci::Pipeline).to receive(:ensure_project_iid!) { |p| p.send(:write_attribute, :iid, 1) } - create(:ci_pipeline, project: project) - - step.perform! + it 'breaks the chain' do + expect(step.break?).to be true end - it_behaves_like 'expectations' + it 'appends validation error' do + expect(pipeline.errors.to_a) + .to include /Failed to persist the pipeline/ + end end end end |