Commit 317ccd65 authored by Sean McGivern's avatar Sean McGivern

Merge branch '349701-add-test-coverage-for-empty-todos-list' into 'master'

Add test coverage for empty todos list

See merge request gitlab-org/gitlab!77843
parents cefde4f9 a2562fd4
...@@ -6,6 +6,7 @@ RSpec.describe 'Dashboard Todos' do ...@@ -6,6 +6,7 @@ RSpec.describe 'Dashboard Todos' do
include DesignManagementTestHelpers include DesignManagementTestHelpers
let_it_be(:user) { create(:user, username: 'john') } let_it_be(:user) { create(:user, username: 'john') }
let_it_be(:user2) { create(:user, username: 'diane') }
let_it_be(:author) { create(:user) } let_it_be(:author) { create(:user) }
let_it_be(:project) { create(:project, :public) } let_it_be(:project) { create(:project, :public) }
let_it_be(:issue) { create(:issue, project: project, due_date: Date.today, title: "Fix bug") } let_it_be(:issue) { create(:issue, project: project, due_date: Date.today, title: "Fix bug") }
...@@ -23,6 +24,19 @@ RSpec.describe 'Dashboard Todos' do ...@@ -23,6 +24,19 @@ RSpec.describe 'Dashboard Todos' do
it 'shows "All done" message' do it 'shows "All done" message' do
expect(page).to have_content 'Your To-Do List shows what to work on next' expect(page).to have_content 'Your To-Do List shows what to work on next'
end end
context 'when user was assigned to an issue and marked it as done' do
before do
sign_in(user)
end
it 'shows "Are you looking for things to do?" message' do
create(:todo, :assigned, :done, user: user, project: project, target: issue, author: user2)
visit dashboard_todos_path
expect(page).to have_content 'Are you looking for things to do? Take a look at open issues, contribute to a merge request, or mention someone in a comment to automatically assign them a new to-do item.'
end
end
end end
context 'when the todo references a merge request' do context 'when the todo references a merge request' do
......
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