diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-05-04 11:17:16 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-05-29 15:03:00 -0400 |
commit | fc57d36018a23c15da013bebf42d51f7a8e9a955 (patch) | |
tree | 8b0b5331eaf4a4925e68562418b7027bfd64eff0 /spec/factories | |
parent | 99ef3a84b558e7b51bce7cbb11a6e235a6cc310b (diff) | |
download | gitlab-ce-fc57d36018a23c15da013bebf42d51f7a8e9a955.tar.gz |
Minor changes in note validation specs
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/notes.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb index 2940ac342a2..6801438165d 100644 --- a/spec/factories/notes.rb +++ b/spec/factories/notes.rb @@ -9,9 +9,9 @@ FactoryGirl.define do author noteable { create(:issue, project: project) } - factory :note_on_issue, traits: [:on_issue], aliases: [:votable_note] factory :note_on_commit, traits: [:on_commit] factory :note_on_commit_diff, traits: [:on_commit, :on_diff], class: LegacyDiffNote + factory :note_on_issue, traits: [:on_issue], aliases: [:votable_note] factory :note_on_merge_request, traits: [:on_merge_request] factory :note_on_merge_request_diff, traits: [:on_merge_request, :on_diff], class: LegacyDiffNote factory :note_on_project_snippet, traits: [:on_project_snippet] @@ -19,14 +19,20 @@ FactoryGirl.define do factory :downvote_note, traits: [:award, :downvote] factory :upvote_note, traits: [:award, :upvote] - trait :on_issue do - noteable_type 'Issue' - end - trait :on_commit do noteable nil + noteable_type 'Commit' + noteable_id nil commit_id RepoHelpers.sample_commit.id - noteable_type "Commit" + end + + trait :on_diff do + line_code "0_184_184" + end + + trait :on_issue do + noteable_type 'Issue' + noteable { create(:issue, project: project) } end trait :on_merge_request do @@ -42,10 +48,6 @@ FactoryGirl.define do noteable { create(:snippet, project: project) } end - trait :on_diff do - line_code "0_184_184" - end - trait :system do system true end |