diff options
| author | Robert Speicher <robert@gitlab.com> | 2016-08-25 19:04:16 +0000 |
|---|---|---|
| committer | Robert Speicher <robert@gitlab.com> | 2016-08-25 19:04:16 +0000 |
| commit | 98eef887a4e80e1c1711d45f8507828f19dd3b0b (patch) | |
| tree | b834afc3db319dd534d38e4f018826e21e9fb189 /spec/features | |
| parent | 34a472f674fa0d26deea1b248b54a44354f889ba (diff) | |
| parent | 7629dc9982f5559972acf9d9b9d98f78ad53e54c (diff) | |
| download | gitlab-ce-98eef887a4e80e1c1711d45f8507828f19dd3b0b.tar.gz | |
Merge branch '19730-mark-as-done' into 'master'
If the received id is still a pending todo mark it as done
## What does this MR do?
Just return properly on stale todos, for me is annoying to mark as done a todo that is already done and the done hung there forever, so I have to refresh the page. I decided to resolve the issue myself.
## What are the relevant issue numbers?
Closes #19730
See merge request !5795
Diffstat (limited to 'spec/features')
| -rw-r--r-- | spec/features/todos/todos_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/features/todos/todos_spec.rb b/spec/features/todos/todos_spec.rb index 0342f4f1d97..32544f3f538 100644 --- a/spec/features/todos/todos_spec.rb +++ b/spec/features/todos/todos_spec.rb @@ -41,6 +41,27 @@ describe 'Dashboard Todos', feature: true do expect(page).to have_content("You're all done!") end end + + context 'todo is stale on the page' do + before do + todos = TodosFinder.new(user, state: :pending).execute + TodoService.new.mark_todos_as_done(todos, user) + end + + describe 'deleting the todo' do + before do + first('.done-todo').click + end + + it 'is removed from the list' do + expect(page).not_to have_selector('.todos-list .todo') + end + + it 'shows "All done" message' do + expect(page).to have_content("You're all done!") + end + end + end end context 'User has Todos with labels spanning multiple projects' do |
