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
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-05-18 20:38:52 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-05-29 22:03:00 +0300
commitdbba60029c84fa091350d3a7d8b2e73cfec25f7e (patch)
tree5024609041e64fe4e27899ea3f40214c4aba0b04 /spec/factories/notes.rb
parentcc2efcf1a681223d5c74eef6fca73cde71dce7c2 (diff)
Improve note factory
Diffstat (limited to 'spec/factories/notes.rb')
-rw-r--r--spec/factories/notes.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb
index 6f9b3568e70..c32e205ee69 100644
--- a/spec/factories/notes.rb
+++ b/spec/factories/notes.rb
@@ -7,7 +7,7 @@ FactoryGirl.define do
project
note "Note"
author
- noteable { create(:issue, project: project) }
+ on_issue
factory :note_on_commit, traits: [:on_commit]
factory :note_on_commit_diff, traits: [:on_commit, :on_diff], class: LegacyDiffNote
@@ -21,8 +21,8 @@ FactoryGirl.define do
trait :on_commit do
noteable nil
- noteable_type 'Commit'
noteable_id nil
+ noteable_type 'Commit'
commit_id RepoHelpers.sample_commit.id
end
@@ -31,17 +31,14 @@ FactoryGirl.define do
end
trait :on_issue do
- noteable_type 'Issue'
noteable { create(:issue, project: project) }
end
trait :on_merge_request do
- noteable_type 'MergeRequest'
noteable { create(:merge_request, source_project: project) }
end
trait :on_project_snippet do
- noteable_type 'Snippet'
noteable { create(:snippet, project: project) }
end