diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-06-14 23:09:48 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-06-17 16:17:43 -0300 |
commit | 2878c990052f78fae3cde21a1d2cd90dd5a85461 (patch) | |
tree | 6b026bd7ec4c80c2f46deef6e2009496a024b200 /features/steps/dashboard/todos.rb | |
parent | bb4a1ef6c1ed4d367e6126ad64033e0286da6f15 (diff) | |
download | gitlab-ce-2878c990052f78fae3cde21a1d2cd90dd5a85461.tar.gz |
Ensure Todos counters doesn't count Todos for projects pending delete
Diffstat (limited to 'features/steps/dashboard/todos.rb')
-rw-r--r-- | features/steps/dashboard/todos.rb | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/features/steps/dashboard/todos.rb b/features/steps/dashboard/todos.rb index 19fedfbfcdf..60152d3da55 100644 --- a/features/steps/dashboard/todos.rb +++ b/features/steps/dashboard/todos.rb @@ -26,14 +26,15 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps end step 'I should see todos assigned to me' do + page.within('.todos-pending-count') { expect(page).to have_content '4' } expect(page).to have_content 'To do 4' expect(page).to have_content 'Done 0' expect(page).to have_link project.name_with_namespace should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title) - should_see_todo(2, "John Doe mentioned you on issue ##{issue.iid}", "#{current_user.to_reference} Wdyt?") - should_see_todo(3, "John Doe assigned you issue ##{issue.iid}", issue.title) - should_see_todo(4, "Mary Jane mentioned you on issue ##{issue.iid}", issue.title) + should_see_todo(2, "John Doe mentioned you on issue #{issue.to_reference}", "#{current_user.to_reference} Wdyt?") + should_see_todo(3, "John Doe assigned you issue #{issue.to_reference}", issue.title) + should_see_todo(4, "Mary Jane mentioned you on issue #{issue.to_reference}", issue.title) end step 'I mark the todo as done' do @@ -41,18 +42,40 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps click_link 'Done' end + page.within('.todos-pending-count') { expect(page).to have_content '3' } expect(page).to have_content 'To do 3' expect(page).to have_content 'Done 1' should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}" end - step 'I click on the "Done" tab' do + step 'I mark all todos as done' do + click_link 'Mark all as done' + + page.within('.todos-pending-count') { expect(page).to have_content '0' } + expect(page).to have_content 'To do 0' + expect(page).to have_content 'Done 4' + expect(page).not_to have_link project.name_with_namespace + should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}" + should_not_see_todo "John Doe mentioned you on issue #{issue.to_reference}" + should_not_see_todo "John Doe assigned you issue #{issue.to_reference}" + should_not_see_todo "Mary Jane mentioned you on issue #{issue.to_reference}" + end + + step 'I should see the todo marked as done' do click_link 'Done 1' + + expect(page).to have_link project.name_with_namespace + should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title, false) end step 'I should see all todos marked as done' do + click_link 'Done 4' + expect(page).to have_link project.name_with_namespace should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference}", merge_request.title, false) + should_see_todo(2, "John Doe mentioned you on issue #{issue.to_reference}", "#{current_user.to_reference} Wdyt?", false) + should_see_todo(3, "John Doe assigned you issue #{issue.to_reference}", issue.title, false) + should_see_todo(4, "Mary Jane mentioned you on issue #{issue.to_reference}", issue.title, false) end step 'I filter by "Enterprise"' do @@ -76,7 +99,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps end step 'I should not see todos related to "Mary Jane" in the list' do - should_not_see_todo "Mary Jane mentioned you on issue ##{issue.iid}" + should_not_see_todo "Mary Jane mentioned you on issue #{issue.to_reference}" end step 'I should not see todos related to "Merge Requests" in the list' do @@ -85,7 +108,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps step 'I should not see todos related to "Assignments" in the list' do should_not_see_todo "John Doe assigned you merge request #{merge_request.to_reference}" - should_not_see_todo "John Doe assigned you issue ##{issue.iid}" + should_not_see_todo "John Doe assigned you issue #{issue.to_reference}" end step 'I click on the todo' do |