summaryrefslogtreecommitdiff
path: root/spec/features/todos
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-09-14 16:50:15 -0400
committerRobert Speicher <rspeicher@gmail.com>2016-09-14 16:50:15 -0400
commite7e628bf959b77d5a58471d224ebd18c4e97032d (patch)
tree6fd0f13502f03553b0ff0ca98a09ab714ea4a91f /spec/features/todos
parentbf6f9f34e9052eca8bce238ae91e7d7172b216eb (diff)
downloadgitlab-ce-e7e628bf959b77d5a58471d224ebd18c4e97032d.tar.gz
Improve validity of spec/features/todos/todos_filtering_spec.rbrs-fix-todos-filtering-spec
Previously, we were checking that a CSS selector string didn't have some page-related content, which, of course it didn't. Now we check against the actual content of the selector, we use a more semantic selector, and we add an additional expectation for the text that _should_ be there, as an additional sanity check.
Diffstat (limited to 'spec/features/todos')
-rw-r--r--spec/features/todos/todos_filtering_spec.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/spec/features/todos/todos_filtering_spec.rb b/spec/features/todos/todos_filtering_spec.rb
index 83cf306437d..b9e66243d84 100644
--- a/spec/features/todos/todos_filtering_spec.rb
+++ b/spec/features/todos/todos_filtering_spec.rb
@@ -29,8 +29,11 @@ describe 'Dashboard > User filters todos', feature: true, js: true do
fill_in 'Search projects', with: project_1.name_with_namespace
click_link project_1.name_with_namespace
end
+
wait_for_ajax
- expect('.prepend-top-default').not_to have_content project_2.name_with_namespace
+
+ expect(page).to have_content project_1.name_with_namespace
+ expect(page).not_to have_content project_2.name_with_namespace
end
it 'filters by author' do
@@ -39,8 +42,11 @@ describe 'Dashboard > User filters todos', feature: true, js: true do
fill_in 'Search authors', with: user_1.name
click_link user_1.name
end
+
wait_for_ajax
- expect('.prepend-top-default').not_to have_content user_2.name
+
+ expect(find('.todos-list')).to have_content user_1.name
+ expect(find('.todos-list')).not_to have_content user_2.name
end
it 'filters by type' do
@@ -48,8 +54,11 @@ describe 'Dashboard > User filters todos', feature: true, js: true do
within '.dropdown-menu-type' do
click_link 'Issue'
end
+
wait_for_ajax
- expect('.prepend-top-default').not_to have_content ' merge request !'
+
+ expect(find('.todos-list')).to have_content issue.to_reference
+ expect(find('.todos-list')).not_to have_content merge_request.to_reference
end
it 'filters by action' do
@@ -57,7 +66,10 @@ describe 'Dashboard > User filters todos', feature: true, js: true do
within '.dropdown-menu-action' do
click_link 'Assigned'
end
+
wait_for_ajax
- expect('.prepend-top-default').not_to have_content ' mentioned '
+
+ expect(find('.todos-list')).to have_content ' assigned you '
+ expect(find('.todos-list')).not_to have_content ' mentioned '
end
end