mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-15 15:46:08 +10:00
Fix Note model spec
This commit is contained in:
+3
-2
@@ -82,8 +82,10 @@ class Note < ActiveRecord::Base
|
||||
def create_cross_reference_note(noteable, mentioner, author)
|
||||
gfm_reference = mentioner_gfm_ref(noteable, mentioner)
|
||||
|
||||
project = noteable.project
|
||||
|
||||
note_options = {
|
||||
project: noteable.project,
|
||||
project: project,
|
||||
author: author,
|
||||
note: cross_reference_note_content(gfm_reference),
|
||||
system: true
|
||||
@@ -95,7 +97,6 @@ class Note < ActiveRecord::Base
|
||||
note_options.merge!(noteable: noteable)
|
||||
end
|
||||
|
||||
|
||||
if noteable.is_a?(ExternalIssue)
|
||||
project.issues_tracker.create_cross_reference_note(noteable, mentioner, author)
|
||||
else
|
||||
|
||||
@@ -380,7 +380,7 @@ describe Note do
|
||||
jira_tracker.destroy!
|
||||
end
|
||||
|
||||
subject { Note.create_cross_reference_note(jira_issue, mergereq, author, project) }
|
||||
subject { Note.create_cross_reference_note(jira_issue, mergereq, author) }
|
||||
|
||||
it { is_expected.to eq(jira_status_message) }
|
||||
end
|
||||
@@ -419,7 +419,7 @@ describe Note do
|
||||
to_return(:body => jira_issue_comments)
|
||||
end
|
||||
|
||||
subject { Note.create_cross_reference_note(jira_issue, commit, author, project) }
|
||||
subject { Note.create_cross_reference_note(jira_issue, commit, author) }
|
||||
|
||||
it { is_expected.to eq(jira_status_message) }
|
||||
end
|
||||
@@ -431,7 +431,7 @@ describe Note do
|
||||
to_return(:body => "{\"comments\":[{\"body\":\"#{message}\"}]}")
|
||||
end
|
||||
|
||||
subject { Note.create_cross_reference_note(jira_issue, commit, author, project) }
|
||||
subject { Note.create_cross_reference_note(jira_issue, commit, author) }
|
||||
it { is_expected.not_to eq(jira_status_message) }
|
||||
end
|
||||
end
|
||||
@@ -450,7 +450,7 @@ describe Note do
|
||||
jira_tracker.destroy!
|
||||
end
|
||||
|
||||
subject { Note.create_cross_reference_note(jira_issue, issue, author, project) }
|
||||
subject { Note.create_cross_reference_note(jira_issue, issue, author) }
|
||||
|
||||
it { is_expected.to eq(jira_status_message) }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user