diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/controllers/dashboard/todos_controller_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/controllers/dashboard/todos_controller_spec.rb')
-rw-r--r-- | spec/controllers/dashboard/todos_controller_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/controllers/dashboard/todos_controller_spec.rb b/spec/controllers/dashboard/todos_controller_spec.rb index abada97fb10..efa00877142 100644 --- a/spec/controllers/dashboard/todos_controller_spec.rb +++ b/spec/controllers/dashboard/todos_controller_spec.rb @@ -113,6 +113,19 @@ RSpec.describe Dashboard::TodosController do expect(response).to redirect_to(dashboard_todos_path(page: last_page, project_id: project.id)) end + + it 'returns directly addressed if filtering by mentioned action_id' do + allow(controller).to receive(:current_user).and_return(user) + + mentioned_todos = [ + create(:todo, :directly_addressed, project: project, user: user, target: issues.first), + create(:todo, :mentioned, project: project, user: user, target: issues.first) + ] + + get :index, params: { action_id: ::Todo::MENTIONED, project_id: project.id } + + expect(assigns(:todos)).to match_array(mentioned_todos) + end end end |