diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-08 13:32:55 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-08 13:32:55 +0000 |
commit | 4c8a1d3a3d2a8ea1e67519ffb70ff5a224b6a26e (patch) | |
tree | 9c70030db97d9a7caaa97388714db7feffc384d5 /spec/features | |
parent | 9ce16b48713e6a7bd8af20ea2f652dad804712fe (diff) | |
parent | e4029070a205351ca9677311c9675f4f933e8f45 (diff) | |
download | gitlab-ce-4c8a1d3a3d2a8ea1e67519ffb70ff5a224b6a26e.tar.gz |
Merge branch '26705-filter-todos-by-manual-add' into 'master'
Filter todos by manual add
Closes #26705
See merge request !8861
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/todos/todos_filtering_spec.rb | 57 |
1 files changed, 50 insertions, 7 deletions
diff --git a/spec/features/todos/todos_filtering_spec.rb b/spec/features/todos/todos_filtering_spec.rb index d1f2bc78884..e8f06916d53 100644 --- a/spec/features/todos/todos_filtering_spec.rb +++ b/spec/features/todos/todos_filtering_spec.rb @@ -98,15 +98,58 @@ describe 'Dashboard > User filters todos', feature: true, js: true do expect(find('.todos-list')).not_to have_content merge_request.to_reference end - it 'filters by action' do - click_button 'Action' - within '.dropdown-menu-action' do - click_link 'Assigned' + describe 'filter by action' do + before do + create(:todo, :build_failed, user: user_1, author: user_2, project: project_1) + create(:todo, :marked, user: user_1, author: user_2, project: project_1, target: issue) end - wait_for_ajax + it 'filters by Assigned' do + filter_action('Assigned') + + expect_to_see_action(:assigned) + end + + it 'filters by Mentioned' do + filter_action('Mentioned') + + expect_to_see_action(:mentioned) + end + + it 'filters by Added' do + filter_action('Added') + + expect_to_see_action(:marked) + end + + it 'filters by Pipelines' do + filter_action('Pipelines') - expect(find('.todos-list')).to have_content ' assigned you ' - expect(find('.todos-list')).not_to have_content ' mentioned ' + expect_to_see_action(:build_failed) + end + + def filter_action(name) + click_button 'Action' + within '.dropdown-menu-action' do + click_link name + end + + wait_for_ajax + end + + def expect_to_see_action(action_name) + action_names = { + assigned: ' assigned you ', + mentioned: ' mentioned ', + marked: ' added a todo for ', + build_failed: ' build failed for ' + } + + action_name_text = action_names.delete(action_name) + expect(find('.todos-list')).to have_content action_name_text + action_names.each_value do |other_action_text| + expect(find('.todos-list')).not_to have_content other_action_text + end + end end end |