diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/helpers/packages_helper_spec.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) | |
download | gitlab-ce-edaa33dee2ff2f7ea3fac488d41558eb5f86d68c.tar.gz |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/helpers/packages_helper_spec.rb')
-rw-r--r-- | spec/helpers/packages_helper_spec.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/spec/helpers/packages_helper_spec.rb b/spec/helpers/packages_helper_spec.rb index 06c6cccd488..8b3c8411fbd 100644 --- a/spec/helpers/packages_helper_spec.rb +++ b/spec/helpers/packages_helper_spec.rb @@ -219,45 +219,4 @@ RSpec.describe PackagesHelper do it { is_expected.to eq(expected_result) } end end - - describe '#package_details_data' do - let_it_be(:package) { create(:package) } - - let(:expected_result) do - { - package_id: package.id, - can_delete: 'true', - project_name: project.name, - group_list_url: '' - } - end - - before do - allow(helper).to receive(:current_user) { project.owner } - allow(helper).to receive(:can?) { true } - end - - context 'in a project without a group' do - it 'populates presenter data' do - result = helper.package_details_data(project, package) - - expect(result).to match(hash_including(expected_result)) - end - end - - context 'in a project with a group' do - let_it_be(:group) { create(:group) } - let_it_be(:project_with_group) { create(:project, group: group) } - - it 'populates presenter data' do - result = helper.package_details_data(project_with_group, package) - expected = expected_result.merge({ - group_list_url: group_packages_path(project_with_group.group), - project_name: project_with_group.name - }) - - expect(result).to match(hash_including(expected)) - end - end - end end |