diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-15 11:58:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-15 11:58:20 +0300 |
commit | 59c9ff627603da03f6a7c330d57a2c765b3c24a3 (patch) | |
tree | dd8f3a2fbc9564818a77d2d8798fcc464d220e8e /spec/models/project_spec.rb | |
parent | 30b4659f2c485885324fd8d67fcd92a2939310a3 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-ee
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 2fe50f8c48a..30114d36a06 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -7119,7 +7119,7 @@ RSpec.describe Project, factory_default: :keep do describe '#package_already_taken?' do let_it_be(:namespace) { create(:namespace, path: 'test') } let_it_be(:project) { create(:project, :public, namespace: namespace) } - let_it_be(:package) { create(:npm_package, project: project, name: "@#{namespace.path}/foo", version: '1.2.3') } + let_it_be_with_reload(:package) { create(:npm_package, project: project, name: "@#{namespace.path}/foo", version: '1.2.3') } subject { project.package_already_taken?(package_name, package_version, package_type: :npm) } @@ -7158,6 +7158,23 @@ RSpec.describe Project, factory_default: :keep do expect(result).to be false end end + + context 'with a pending_destruction package' do + before do + package.pending_destruction! + end + + where(:package_name, :package_version, :expected_result) do + '@test/bar' | '1.2.3' | false + '@test/bar' | '5.5.5' | false + '@test/foo' | '1.2.3' | false + '@test/foo' | '5.5.5' | false + end + + with_them do + it { is_expected.to eq expected_result} + end + end end end |