diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-18 03:59:19 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 13:13:46 +0300 |
commit | 2120e2dd95dbbab81c4b818d6d860139bb6c5f0b (patch) | |
tree | 45c46b71d93851138f02d0891c5581616273e0d3 /spec/services | |
parent | 213d1a4768b4bb83aa1ca827682468c381cbe9c9 (diff) |
Replace remaining references to `Note.create_cross_reference_note`
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/git_push_service_spec.rb | 10 | ||||
-rw-r--r-- | spec/services/notification_service_spec.rb | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index 648b2afd7fb..dfbece18cdc 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -166,15 +166,15 @@ describe GitPushService do end it "creates a note if a pushed commit mentions an issue" do - expect(Note).to receive(:create_cross_reference_note).with(issue, commit, commit_author) + expect(SystemNoteService).to receive(:cross_reference).with(issue, commit, commit_author) service.execute(project, user, @oldrev, @newrev, @ref) end it "only creates a cross-reference note if one doesn't already exist" do - Note.create_cross_reference_note(issue, commit, user) + SystemNoteService.cross_reference(issue, commit, user) - expect(Note).not_to receive(:create_cross_reference_note).with(issue, commit, commit_author) + expect(SystemNoteService).not_to receive(:cross_reference).with(issue, commit, commit_author) service.execute(project, user, @oldrev, @newrev, @ref) end @@ -184,7 +184,7 @@ describe GitPushService do author_name: 'unknown name', author_email: 'unknown@email.com' ) - expect(Note).to receive(:create_cross_reference_note).with(issue, commit, user) + expect(SystemNoteService).to receive(:cross_reference).with(issue, commit, user) service.execute(project, user, @oldrev, @newrev, @ref) end @@ -193,7 +193,7 @@ describe GitPushService do allow(project.repository).to receive(:commits_between).with(@blankrev, @newrev).and_return([]) allow(project.repository).to receive(:commits_between).with("master", @newrev).and_return([commit]) - expect(Note).to receive(:create_cross_reference_note).with(issue, commit, commit_author) + expect(SystemNoteService).to receive(:cross_reference).with(issue, commit, commit_author) service.execute(project, user, @blankrev, @newrev, 'refs/heads/other') end diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 62a99d15952..253e5823499 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -58,7 +58,7 @@ describe NotificationService do end it 'filters out "mentioned in" notes' do - mentioned_note = Note.create_cross_reference_note(mentioned_issue, issue, issue.author) + mentioned_note = SystemNoteService.cross_reference(mentioned_issue, issue, issue.author) expect(Notify).not_to receive(:note_issue_email) notification.new_note(mentioned_note) @@ -130,7 +130,7 @@ describe NotificationService do end it 'filters out "mentioned in" notes' do - mentioned_note = Note.create_cross_reference_note(mentioned_issue, issue, issue.author) + mentioned_note = SystemNoteService.cross_reference(mentioned_issue, issue, issue.author) expect(Notify).not_to receive(:note_issue_email) notification.new_note(mentioned_note) |