Commit 9095e841 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'sh-remove-ee-weight-override' into 'master'

Remove EE override for fixing extra comma in weights

Closes #6793

See merge request gitlab-org/gitlab-ee!6471
parents 0c6bf901 f2beee7d
......@@ -11,24 +11,6 @@ module EE
noteable.is_a?(Epic)
end
# Remove with https://gitlab.com/gitlab-org/gitlab-ee/issues/6793
def note
raw_note = super
return raw_note unless system? && system_note_metadata&.action == 'weight'
raw_note.delete(',')
end
# Remove with https://gitlab.com/gitlab-org/gitlab-ee/issues/6783
def note_html
raw_note_html = super
return raw_note_html unless system? && system_note_metadata&.action == 'weight'
raw_note_html.delete(',')
end
override :for_project_noteable?
def for_project_noteable?
!for_epic? && super
......
require 'spec_helper'
describe EE::Note do
# Remove with https://gitlab.com/gitlab-org/gitlab-ee/issues/6793
describe "#note and #note_html overrides for weight" do
using RSpec::Parameterized::TableSyntax
where(:system, :action, :result) do
false | nil | 'this, had, some, commas, originally'
true | nil | 'this, had, some, commas, originally'
true | 'relate' | 'this, had, some, commas, originally'
true | 'weight' | 'this had some commas originally'
end
with_them do
let(:note) { create(:note, system: system, note: 'this, had, some, commas, originally') }
before do
create(:system_note_metadata, action: action, note: note) if action
end
it 'returns the right raw note' do
expect(note.note).to eq(result)
end
it 'returns the right HTML' do
expect(note.note_html).to eq("<p dir=\"auto\">#{result}</p>")
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment