diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2017-01-16 14:11:08 +0100 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2017-02-17 22:12:19 +0100 |
commit | 26160459b56019f445a7d29abc0b72f591e1d2a9 (patch) | |
tree | bf7150c7eda9436f001decae56407ca3b3f718f8 /features | |
parent | 63330af84fb6ecdce4611af238af4233a436e260 (diff) | |
download | gitlab-ce-26160459b56019f445a7d29abc0b72f591e1d2a9.tar.gz |
Todo done clicking is kind of unusable.
The Done button will change to an Undo button and the line item will be greyed out.
Bold links will be unbolded.
The user can undo the task by clicking the Undo button.
Diffstat (limited to 'features')
-rw-r--r-- | features/steps/dashboard/todos.rb | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/features/steps/dashboard/todos.rb b/features/steps/dashboard/todos.rb index 2bbc43b491f..eb906a55a83 100644 --- a/features/steps/dashboard/todos.rb +++ b/features/steps/dashboard/todos.rb @@ -47,7 +47,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps 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(full: true)}" + should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference(full: true)}", merge_request.title, state: :done_reversible) end step 'I mark all todos as done' do @@ -71,7 +71,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps 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(full: true)}", merge_request.title, false) + should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference(full: true)}", merge_request.title, state: :done_irreversible) end step 'I should see all todos marked as done' do @@ -81,10 +81,10 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps 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_reference}", merge_request.title, false) - should_see_todo(2, "John Doe mentioned you on issue #{issue_reference}", "#{current_user.to_reference} Wdyt?", false) - should_see_todo(3, "John Doe assigned you issue #{issue_reference}", issue.title, false) - should_see_todo(4, "Mary Jane mentioned you on issue #{issue_reference}", issue.title, false) + should_see_todo(1, "John Doe assigned you merge request #{merge_request_reference}", merge_request.title, state: :done_irreversible) + should_see_todo(2, "John Doe mentioned you on issue #{issue_reference}", "#{current_user.to_reference} Wdyt?", state: :done_irreversible) + should_see_todo(3, "John Doe assigned you issue #{issue_reference}", issue.title, state: :done_irreversible) + should_see_todo(4, "Mary Jane mentioned you on issue #{issue_reference}", issue.title, state: :done_irreversible) end step 'I filter by "Enterprise"' do @@ -140,15 +140,20 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps page.should have_css('.identifier', text: 'Merge Request !1') end - def should_see_todo(position, title, body, pending = true) + def should_see_todo(position, title, body, state: :pending) page.within(".todo:nth-child(#{position})") do expect(page).to have_content title expect(page).to have_content body - if pending + if state == :pending expect(page).to have_link 'Done' - else + elsif state == :done_reversible + expect(page).to have_link 'Undo' + elsif state == :done_irreversible + expect(page).not_to have_link 'Undo' expect(page).not_to have_link 'Done' + else + raise 'Invalid state given, valid states: :pending, :done_reversible, :done_irreversible' end end end |