summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authormicael.bergeron <micaelbergeron@gmail.com>2017-12-01 14:08:30 -0500
committermicael.bergeron <micaelbergeron@gmail.com>2017-12-07 09:06:59 -0500
commit360b94ceba146935a40b02f39ed3d833eaea134a (patch)
tree37a6c9b9e3424dfc0cb5446ddb17be97bb34f379 /spec/factories
parent17075a0bdc0c271e9f7a4f25829c0517656d5871 (diff)
downloadgitlab-ce-360b94ceba146935a40b02f39ed3d833eaea134a.tar.gz
adding view and feature specs
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/notes.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb
index ab4ae123429..471bfb3213a 100644
--- a/spec/factories/notes.rb
+++ b/spec/factories/notes.rb
@@ -63,13 +63,19 @@ FactoryGirl.define do
factory :diff_note_on_commit, traits: [:on_commit], class: DiffNote do
association :project, :repository
+
+ transient do
+ line_number 14
+ diff_refs { project.commit(commit_id).try(:diff_refs) }
+ end
+
position do
Gitlab::Diff::Position.new(
old_path: "files/ruby/popen.rb",
new_path: "files/ruby/popen.rb",
old_line: nil,
- new_line: 14,
- diff_refs: project.commit(commit_id).try(:diff_refs)
+ new_line: line_number,
+ diff_refs: diff_refs
)
end
end