From 612820b2964e77397b6d85f74eb96888b72c4cbd Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
Date: Mon, 26 Sep 2016 19:04:02 +0800
Subject: [PATCH] Fix test by having a real commit

---
 spec/models/ci/pipeline_spec.rb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 050ab50f84f..787042cf055 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -525,10 +525,18 @@ describe Ci::Pipeline, models: true do
   end
 
   describe 'notifications when pipeline success or failed' do
+    let(:project) { create(:project) }
+
+    let(:pipeline) do
+      create(:ci_pipeline,
+             project: project,
+             sha: project.commit('master').sha,
+             user: create(:user))
+    end
+
     before do
       reset_delivered_emails!
 
-      pipeline.update(user: create(:user))
       pipeline.enqueue
       pipeline.run
     end
-- 
GitLab