Fix Note model spec

This commit is contained in:
Robert Speicher
2015-04-28 16:01:34 -04:00
parent 2cca78b175
commit 5ada96db54
2 changed files with 7 additions and 6 deletions
+3 -2
View File
@@ -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
+4 -4
View File
@@ -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