summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-10-16 00:51:25 -0700
committerStan Hu <stanhu@gmail.com>2015-10-16 00:51:25 -0700
commitf726df26c28666e640e566d50f363994e71cf681 (patch)
tree3b3d69a9033a74ac43d5d36aa7a462b6cb9e5791
parent888c1a3fc53ff0318cd69d0e7f1edad25f306713 (diff)
downloadgitlab-ce-f726df26c28666e640e566d50f363994e71cf681.tar.gz
Reorder system note verb to say "Restored source branch X" instead of "Source branch X restored"
-rw-r--r--app/services/system_note_service.rb4
-rw-r--r--spec/services/merge_requests/refresh_service_spec.rb2
-rw-r--r--spec/services/system_note_service_spec.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index c0a5c3aeb53..37f454cfc3f 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -179,7 +179,7 @@ class SystemNoteService
#
# Example Note text:
#
- # "Target branch `feature` deleted"
+ # "Restored target branch `feature`"
#
# Returns the created Note object
def self.change_branch_presence(noteable, project, author, branch_type, branch, presence)
@@ -189,7 +189,7 @@ class SystemNoteService
else
'deleted'
end
- body = "#{branch_type.to_s} branch `#{branch}` #{verb}".capitalize
+ body = "#{verb} #{branch_type.to_s} branch `#{branch}`".capitalize
create_note(noteable: noteable, project: project, author: author, note: body)
end
diff --git a/spec/services/merge_requests/refresh_service_spec.rb b/spec/services/merge_requests/refresh_service_spec.rb
index 463cd594fb0..227ac995ec2 100644
--- a/spec/services/merge_requests/refresh_service_spec.rb
+++ b/spec/services/merge_requests/refresh_service_spec.rb
@@ -121,7 +121,7 @@ describe MergeRequests::RefreshService do
expect(@merge_request).to be_open
notes = @fork_merge_request.notes.reorder(:created_at).map(&:note)
- expect(notes[0]).to include('Source branch `master` restored')
+ expect(notes[0]).to include('Restored source branch `master`')
expect(notes[1]).to include('Added 4 commits')
expect(@fork_merge_request).to be_open
end
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index 699b2e3441f..a45130bd473 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -249,7 +249,7 @@ describe SystemNoteService do
context 'when source branch deleted' do
it 'sets the note text' do
- expect(subject.note).to eq "Source branch `feature` deleted"
+ expect(subject.note).to eq "Deleted source branch `feature`"
end
end
end