diff options
Diffstat (limited to 'spec/controllers/dashboard_controller_spec.rb')
-rw-r--r-- | spec/controllers/dashboard_controller_spec.rb | 31 |
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 |