Commit 71cc0c4c authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Remove authorized_only param not allowing public projects listing

parent 66705ad6
......@@ -25,7 +25,7 @@ module IssueLinks
def issues
authorized_issues = IssuesFinder
.new(@current_user, authorized_only: true, feature_availability_check: false)
.new(@current_user, feature_availability_check: false)
.execute
.reorder(nil)
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe IssueLinks::ListService, service: true do
let(:user) { create :user }
let(:project) { create(:project_empty_repo) }
let(:project) { create(:project_empty_repo, :private) }
let(:issue) { create :issue, project: project }
let(:user_role) { :developer }
......@@ -38,7 +38,7 @@ describe IssueLinks::ListService, service: true do
it 'verifies number of queries' do
recorded = ActiveRecord::QueryRecorder.new { subject }
expect(recorded.count).to be_within(1).of(35)
expect(recorded.count).to be_within(1).of(37)
end
it 'returns related issues JSON' do
......@@ -73,6 +73,19 @@ describe IssueLinks::ListService, service: true do
end
end
context 'referencing a public project issue' do
let(:public_project) { create :empty_project, :public }
let(:issue_b) { create :issue, project: public_project }
let!(:issue_link) do
create(:issue_link, source: issue, target: issue_b)
end
it 'presents issue' do
expect(subject.size).to eq(1)
end
end
context 'referencing issue with removed relationships' do
context 'when referenced a deleted issue' do
let(:issue_b) { create :issue, project: project }
......
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