summaryrefslogtreecommitdiff
path: root/spec/services/system_notes
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/system_notes')
-rw-r--r--spec/services/system_notes/issuables_service_spec.rb8
-rw-r--r--spec/services/system_notes/merge_requests_service_spec.rb20
2 files changed, 14 insertions, 14 deletions
diff --git a/spec/services/system_notes/issuables_service_spec.rb b/spec/services/system_notes/issuables_service_spec.rb
index e78b00fb67a..b70c5e899fc 100644
--- a/spec/services/system_notes/issuables_service_spec.rb
+++ b/spec/services/system_notes/issuables_service_spec.rb
@@ -373,7 +373,7 @@ RSpec.describe ::SystemNotes::IssuablesService do
before do
# Mention issue (noteable) from commit0
system_note = service.cross_reference(commit0)
- system_note.update(note: system_note.note.capitalize)
+ system_note.update!(note: system_note.note.capitalize)
end
it 'is truthy when already mentioned' do
@@ -407,7 +407,7 @@ RSpec.describe ::SystemNotes::IssuablesService do
before do
# Mention commit1 from commit0
system_note = service.cross_reference(commit1)
- system_note.update(note: system_note.note.capitalize)
+ system_note.update!(note: system_note.note.capitalize)
end
it 'is truthy when already mentioned' do
@@ -436,7 +436,7 @@ RSpec.describe ::SystemNotes::IssuablesService do
context 'legacy capitalized cross reference' do
before do
system_note = service.cross_reference(commit0)
- system_note.update(note: system_note.note.capitalize)
+ system_note.update!(note: system_note.note.capitalize)
end
it 'is true when a fork mentions an external issue' do
@@ -582,7 +582,7 @@ RSpec.describe ::SystemNotes::IssuablesService do
it 'creates the note text correctly' do
[:issue, :merge_request].each do |type|
- issuable = create(type)
+ issuable = create(type) # rubocop:disable Rails/SaveBang
service = described_class.new(noteable: issuable, author: author)
expect(service.discussion_lock.note)
diff --git a/spec/services/system_notes/merge_requests_service_spec.rb b/spec/services/system_notes/merge_requests_service_spec.rb
index 067e1cef64d..50d16231e8f 100644
--- a/spec/services/system_notes/merge_requests_service_spec.rb
+++ b/spec/services/system_notes/merge_requests_service_spec.rb
@@ -51,44 +51,44 @@ RSpec.describe ::SystemNotes::MergeRequestsService do
end
end
- describe '.handle_merge_request_wip' do
+ describe '.handle_merge_request_draft' do
context 'adding draft note' do
let(:noteable) { create(:merge_request, source_project: project, title: 'Draft: Lorem ipsum') }
- subject { service.handle_merge_request_wip }
+ subject { service.handle_merge_request_draft }
it_behaves_like 'a system note' do
let(:action) { 'title' }
end
it 'sets the note text' do
- expect(subject.note).to eq 'marked as a **Work In Progress**'
+ expect(subject.note).to eq 'marked this merge request as **draft**'
end
end
- context 'removing wip note' do
- subject { service.handle_merge_request_wip }
+ context 'removing draft note' do
+ subject { service.handle_merge_request_draft }
it_behaves_like 'a system note' do
let(:action) { 'title' }
end
it 'sets the note text' do
- expect(subject.note).to eq 'unmarked as a **Work In Progress**'
+ expect(subject.note).to eq 'marked this merge request as **ready**'
end
end
end
- describe '.add_merge_request_wip_from_commit' do
- subject { service.add_merge_request_wip_from_commit(noteable.diff_head_commit) }
+ describe '.add_merge_request_draft_from_commit' do
+ subject { service.add_merge_request_draft_from_commit(noteable.diff_head_commit) }
it_behaves_like 'a system note' do
let(:action) { 'title' }
end
- it "posts the 'marked as a Work In Progress from commit' system note" do
+ it "posts the 'marked this merge request as draft from commit' system note" do
expect(subject.note).to match(
- /marked as a \*\*Work In Progress\*\* from #{Commit.reference_pattern}/
+ /marked this merge request as \*\*draft\*\* from #{Commit.reference_pattern}/
)
end
end