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
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-26 14:50:48 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-05-29 22:03:00 +0300
commit21d0cddd456c03e776a8b30e4695ede94c400792 (patch)
treed5e72a8cf3be922666bbe0fe82c3aec6a8f50866 /spec
parent0e613db76d8d6e8521a3b4d546f552c8d184ffa1 (diff)
Do not override foreign attributes in note factory
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/notes.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb
index 7e9378ab625..cabab0c2207 100644
--- a/spec/factories/notes.rb
+++ b/spec/factories/notes.rb
@@ -4,10 +4,10 @@ include ActionDispatch::TestProcess
FactoryGirl.define do
factory :note do
+ project
note "Note"
author
- noteable { create(:issue) }
- project { noteable.project }
+ noteable { create(:issue, project: project) }
factory :note_on_issue, aliases: [:votable_note]
factory :note_on_commit, traits: [:on_commit]
@@ -20,7 +20,6 @@ FactoryGirl.define do
factory :upvote_note, traits: [:award, :upvote]
trait :on_commit do
- project
noteable nil
commit_id RepoHelpers.sample_commit.id
noteable_type "Commit"
@@ -31,11 +30,11 @@ FactoryGirl.define do
end
trait :on_merge_request do
- noteable { create(:merge_request) }
+ noteable { create(:merge_request, project: project) }
end
trait :on_project_snippet do
- noteable { create(:snippet) }
+ noteable { create(:snippet, project: project) }
end
trait :system do