Commit 93ab5856 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Use factory instead of using new directly. Feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15765156
parent a14d6a9e
...@@ -524,18 +524,11 @@ describe MergeRequest, models: true do ...@@ -524,18 +524,11 @@ describe MergeRequest, models: true do
end end
context 'with unsaved merge request' do context 'with unsaved merge request' do
let(:project) { create(:project) } subject { build(:merge_request) }
subject do
MergeRequest.new(source_project: project,
target_project: project,
source_branch: 'master',
target_branch: 'feature')
end
let!(:pipeline) do let!(:pipeline) do
create(:ci_empty_pipeline, create(:ci_empty_pipeline,
project: project, project: subject.project,
sha: subject.diff_head_sha, sha: subject.diff_head_sha,
ref: subject.source_branch) ref: subject.source_branch)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment