Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 12:40:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 12:40:42 +0300
commitee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch)
treef8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/controllers/dashboard_controller_spec.rb
parent62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff)
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/controllers/dashboard_controller_spec.rb')
-rw-r--r--spec/controllers/dashboard_controller_spec.rb31
1 files changed, 28 insertions, 3 deletions
diff --git a/spec/controllers/dashboard_controller_spec.rb b/spec/controllers/dashboard_controller_spec.rb
index aed310531e6..21810f64cb4 100644
--- a/spec/controllers/dashboard_controller_spec.rb
+++ b/spec/controllers/dashboard_controller_spec.rb
@@ -4,11 +4,14 @@ require 'spec_helper'
RSpec.describe DashboardController do
context 'signed in' do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:project) { create(:project) }
- before do
+ before_all do
project.add_maintainer(user)
+ end
+
+ before do
sign_in(user)
end
@@ -30,6 +33,28 @@ RSpec.describe DashboardController do
end
it_behaves_like 'issuables requiring filter', :issues
+
+ it 'includes tasks in issue list' do
+ task = create(:work_item, :task, project: project, author: user)
+
+ get :issues, params: { author_id: user.id }
+
+ expect(assigns[:issues].map(&:id)).to include(task.id)
+ end
+
+ context 'when work_items is disabled' do
+ before do
+ stub_feature_flags(work_items: false)
+ end
+
+ it 'does not include tasks in issue list' do
+ task = create(:work_item, :task, project: project, author: user)
+
+ get :issues, params: { author_id: user.id }
+
+ expect(assigns[:issues].map(&:id)).not_to include(task.id)
+ end
+ end
end
describe 'GET merge requests' do