diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-27 21:15:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-27 21:15:03 +0300 |
commit | 3538972a0a6417e01f8e44c716d061520841cbce (patch) | |
tree | 32f13d48f0c18858dade1f260e49208ad26f4c40 /spec/models | |
parent | 1403e9bc459bcf37c9fdfb61aadd268d11b0abfd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/note_spec.rb | 10 | ||||
-rw-r--r-- | spec/models/packages/package_spec.rb | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 1fce1f97dcb..670a6237788 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -1839,6 +1839,12 @@ RSpec.describe Note do let(:note) { create(:note, :system, :on_issue, note: original_note_body) } it { is_expected.to eq(expected_text_replacement) } + + context 'context when note and cache are null (happens in bulk insert)' do + let(:note) { build(:note, :system, :on_issue, note: nil, note_html: nil).tap { |note| note.save!(validate: false) } } + + it { is_expected.to be_in([nil, '']) } + end end end end @@ -1868,7 +1874,7 @@ RSpec.describe Note do let(:expected_text_replacement) { '<p data-sourcepos="1:1-1:48" dir="auto">marked the checklist item <strong>task 1</strong> as completed</p>' } before do - note.update_columns(note_html: unchanged_note_body) + note.update_columns(note_html: unchanged_note_body) unless note.note.nil? end end @@ -1878,7 +1884,7 @@ RSpec.describe Note do let(:expected_text_replacement) { '<p data-sourcepos="1:1-1:48" dir="auto">marked the checklist item <strong>task 1</strong> as incomplete</p>' } before do - note.update_columns(note_html: unchanged_note_body) + note.update_columns(note_html: unchanged_note_body) unless note.note.nil? end end end diff --git a/spec/models/packages/package_spec.rb b/spec/models/packages/package_spec.rb index fb88dbb4212..0edb04224a3 100644 --- a/spec/models/packages/package_spec.rb +++ b/spec/models/packages/package_spec.rb @@ -904,6 +904,14 @@ RSpec.describe Packages::Package, type: :model do it { is_expected.to match_array([pypi_package]) } end + describe '.with_case_insensitive_version' do + let_it_be(:nuget_package) { create(:nuget_package, version: '1.0.0-ABC') } + + subject { described_class.with_case_insensitive_version('1.0.0-abC') } + + it { is_expected.to match_array([nuget_package]) } + end + context 'status scopes' do let_it_be(:default_package) { create(:maven_package, :default) } let_it_be(:hidden_package) { create(:maven_package, :hidden) } |