From 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jun 2020 11:18:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-1-stable-ee --- spec/helpers/application_helper_spec.rb | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'spec/helpers/application_helper_spec.rb') diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 05231cc6d09..75377356445 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -278,7 +278,7 @@ describe ApplicationHelper do page: 'application', page_type_id: nil, find_file: nil, - group: '' + group: nil } ) end @@ -317,7 +317,7 @@ describe ApplicationHelper do page: 'application', page_type_id: nil, find_file: nil, - group: '', + group: nil, project_id: project.id, project: project.name, namespace_id: project.namespace.id @@ -325,6 +325,25 @@ describe ApplicationHelper do ) end + context 'when @project is owned by a group' do + let_it_be(:project) { create(:project, :repository, group: create(:group)) } + + it 'includes all possible body data elements and associates the project elements with project' do + expect(helper).to receive(:can?).with(nil, :download_code, project) + expect(helper.body_data).to eq( + { + page: 'application', + page_type_id: nil, + find_file: nil, + group: project.group.name, + project_id: project.id, + project: project.name, + namespace_id: project.namespace.id + } + ) + end + end + context 'when controller is issues' do before do stub_controller_method(:controller_path, 'projects:issues') @@ -342,7 +361,7 @@ describe ApplicationHelper do page: 'projects:issues:show', page_type_id: issue.id, find_file: nil, - group: '', + group: nil, project_id: issue.project.id, project: issue.project.name, namespace_id: issue.project.namespace.id -- cgit v1.2.3