diff options
Diffstat (limited to 'spec/workers/post_receive_spec.rb')
-rw-r--r-- | spec/workers/post_receive_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index 94ff3457902..b8e73682c91 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -48,6 +48,22 @@ describe PostReceive do PostReceive.new.perform(pwd(project), key_id, base64_changes) end end + + context "gitlab-ci.yml" do + subject { PostReceive.new.perform(pwd(project), key_id, base64_changes) } + + context "creates a Ci::Pipeline for every change" do + before { stub_ci_pipeline_to_return_yaml_file } + + it { expect{ subject }.to change{ Ci::Pipeline.count }.by(2) } + end + + context "does not create a Ci::Pipeline" do + before { stub_ci_pipeline_yaml_file(nil) } + + it { expect{ subject }.not_to change{ Ci::Pipeline.count } } + end + end end context "webhook" do |