Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/post_receive_spec.rb')
-rw-r--r--spec/workers/post_receive_spec.rb16
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..2f465bcf1e3 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::Commit for every change" do
+ before { stub_ci_commit_to_return_yaml_file }
+
+ it { expect{ subject }.to change{ Ci::Commit.count }.by(2) }
+ end
+
+ context "does not create a Ci::Commit" do
+ before { stub_ci_commit_yaml_file(nil) }
+
+ it { expect{ subject }.to_not change{ Ci::Commit.count } }
+ end
+ end
end
context "webhook" do