diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-18 18:15:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-18 18:15:16 +0300 |
commit | 9ee9d3012b3747270beb6dec6200d632d8afd0e3 (patch) | |
tree | 13dd297abb01c7b45261289c1f97a63dcd0a9fc3 /spec/models | |
parent | 00cfeb7c25bdbd460efb83ad846cb924e73ee150 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/milestone_spec.rb | 20 | ||||
-rw-r--r-- | spec/models/namespace/package_setting_spec.rb | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 15bcbb3962c..79b663807b4 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -772,4 +772,24 @@ RSpec.describe Milestone, feature_category: :team_planning do it { is_expected.to eq(false) } end end + + describe '.with_ids_or_title' do + subject(:milestones) { described_class.with_ids_or_title(ids: ids, title: title) } + + let_it_be(:milestone1) { create(:milestone, title: 'Foo') } + let_it_be(:milestone2) { create(:milestone) } + + let(:ids) { [milestone1.id] } + let(:title) { milestone2.title } + + before do + # Milestones below should not be returned + create(:milestone, title: 'Bar') + create(:milestone, id: 10) + end + + it 'returns milestones with matching id or title' do + expect(milestones).to contain_exactly(milestone1, milestone2) + end + end end diff --git a/spec/models/namespace/package_setting_spec.rb b/spec/models/namespace/package_setting_spec.rb index e6096bc9267..f06490d7999 100644 --- a/spec/models/namespace/package_setting_spec.rb +++ b/spec/models/namespace/package_setting_spec.rb @@ -16,6 +16,9 @@ RSpec.describe Namespace::PackageSetting, feature_category: :package_registry do it { is_expected.to validate_inclusion_of(:nuget_duplicates_allowed).in_array([true, false]) } end + it { is_expected.to allow_value(true, false).for(:nuget_symbol_server_enabled) } + it { is_expected.not_to allow_value(nil).for(:nuget_symbol_server_enabled) } + describe 'regex values' do let_it_be(:package_settings) { create(:namespace_package_setting) } |