diff options
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/create_commit_service_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/create_commit_service_spec.rb b/spec/services/create_commit_service_spec.rb index d8f404e..725ea08 100644 --- a/spec/services/create_commit_service_spec.rb +++ b/spec/services/create_commit_service_spec.rb @@ -20,5 +20,18 @@ describe CreateCommitService do it { should be_false } end + + context "deploy builds" do + it "calls create_deploy_builds if there are no builds" do + project.jobs.destroy_all + Commit.any_instance.should_receive(:create_deploy_builds) + service.execute(project, ref: 'refs/heads/master', before: '00000000', after: '31das312') + end + + it "does not call create_deploy_builds if there is build" do + Commit.any_instance.should_not_receive(:create_deploy_builds) + service.execute(project, ref: 'refs/heads/master', before: '00000000', after: '31das312') + end + end end end |