Commit fa81338f authored by Thong Kuah's avatar Thong Kuah

Fixes a type mismatch when rendering tags with private pipelines

parent 111239ad
...@@ -12,7 +12,7 @@ module Ci ...@@ -12,7 +12,7 @@ module Ci
end end
def execute def execute
return [] unless Ability.allowed?(@current_user, :read_pipeline, @project) return {} unless Ability.allowed?(@current_user, :read_pipeline, @project)
commit_statuses commit_statuses
end end
......
...@@ -152,8 +152,8 @@ RSpec.describe Ci::CommitStatusesFinder, '#execute' do ...@@ -152,8 +152,8 @@ RSpec.describe Ci::CommitStatusesFinder, '#execute' do
project.project_feature.update!(builds_access_level: ProjectFeature::PRIVATE) project.project_feature.update!(builds_access_level: ProjectFeature::PRIVATE)
end end
it 'returns nil' do it 'returns a blank hash' do
expect(subject).to be_empty expect(subject).to eq({})
end end
end end
...@@ -170,8 +170,8 @@ RSpec.describe Ci::CommitStatusesFinder, '#execute' do ...@@ -170,8 +170,8 @@ RSpec.describe Ci::CommitStatusesFinder, '#execute' do
status: :running) status: :running)
end end
it 'returns nil' do it 'returns a blank hash' do
expect(private_subject).to be_empty expect(private_subject).to eq({})
end end
end end
end end
......
...@@ -81,5 +81,14 @@ RSpec.describe 'projects/tags/index.html.haml' do ...@@ -81,5 +81,14 @@ RSpec.describe 'projects/tags/index.html.haml' do
expect(page.all('.tags .content-list li')).not_to have_css 'svg.s24' expect(page.all('.tags .content-list li')).not_to have_css 'svg.s24'
end end
it 'shows no build status or placeholder when pipelines are private' do
project.project_feature.update!(builds_access_level: ProjectFeature::PRIVATE)
assign(:tag_pipeline_statuses, Ci::CommitStatusesFinder.new(project, project.repository, build(:user), tags).execute)
render
expect(page.all('.tags .content-list li')).not_to have_css 'svg.s24'
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment