Commit dc7fd2c1 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'issue_233479-hide_test_cases_from_group_issues_list' into 'master'

Hide test cases from dashboard and group issues list

See merge request gitlab-org/gitlab!44052
parents 22dc9458 8c55118b
......@@ -59,6 +59,9 @@ module IssuableCollectionsAction
end
def finder_options
super.merge(non_archived: true)
super.merge(
non_archived: true,
issue_types: Issue::TYPES_FOR_LIST
)
end
end
......@@ -15,6 +15,16 @@ RSpec.describe DashboardController do
describe 'GET issues' do
it_behaves_like 'issuables list meta-data', :issue, :issues
it_behaves_like 'issuables requiring filter', :issues
it 'lists only incidents and issues' do
issue = create(:incident, project: project, author: user)
incident = create(:incident, project: project, author: user)
create(:quality_test_case, project: project, author: user)
get :issues, params: { author_id: user.id }
expect(assigns(:issues)).to match_array([issue, incident])
end
end
describe 'GET merge requests' do
......
......@@ -389,8 +389,8 @@ RSpec.describe GroupsController, factory_default: :keep do
end
describe 'GET #issues', :sidekiq_might_not_need_inline do
let(:issue_1) { create(:issue, project: project, title: 'foo') }
let(:issue_2) { create(:issue, project: project, title: 'bar') }
let_it_be(:issue_1) { create(:issue, project: project, title: 'foo') }
let_it_be(:issue_2) { create(:issue, project: project, title: 'bar') }
before do
create_list(:award_emoji, 3, awardable: issue_2)
......@@ -400,6 +400,15 @@ RSpec.describe GroupsController, factory_default: :keep do
sign_in(user)
end
it 'lists only incidents and issues' do
incident = create(:incident, project: project)
create(:quality_test_case, project: project)
get :issues, params: { id: group.to_param }
expect(assigns(:issues)).to match_array([issue_1, issue_2, incident])
end
context 'sorting by votes' do
it 'sorts most popular issues' do
get :issues, params: { id: group.to_param, sort: 'upvotes_desc' }
......
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