summaryrefslogtreecommitdiff
path: root/spec/features/todos/todos_filtering_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-04 22:37:44 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-04 22:37:44 +0800
commitfb9a0e5277f9825d7faf991c0600a7247b268fe8 (patch)
tree35000cd71ebf5de840c2c931d2f1c7a9b7357dad /spec/features/todos/todos_filtering_spec.rb
parentce1dc4c25d3464b7a9a1b21d93157c9fed98f705 (diff)
parent5368b9f249485e254a90fe7daa551d61412bee26 (diff)
downloadgitlab-ce-fb9a0e5277f9825d7faf991c0600a7247b268fe8.tar.gz
Merge remote-tracking branch 'upstream/master' into show-status-from-branch
* upstream/master: (35 commits) Only skip group when it's actually a group in the "Share with group" select Fix: Todos Filter Shows All Users Fix: Guest sees some repository details and gets 404 Move shared params to a helper GrapeDSL for project hooks Update commits.scss updated styling commit SHA on branches page + added to changelog change build list height to show 6,5 builds + improve padding of list, with first/last child selectors Ignore builds directory from eslint Add changelog entry Document multiple repository storage paths Allow multiple repository storage shards to be enabled, and automatically round-robin between them Cleaned up global namespace JS Add tip for using Chrome to run and debug teaspoon tests. Add CHANGELOG entry file Add jquery.timeago.js to application.js Update match-regex to fix filename convention Move jquery.timeago to vendor directory Change a bunch of doc links to either relative or https://docs.gitlab.com. Show log corresponding to env in admin/logs ...
Diffstat (limited to 'spec/features/todos/todos_filtering_spec.rb')
-rw-r--r--spec/features/todos/todos_filtering_spec.rb53
1 files changed, 45 insertions, 8 deletions
diff --git a/spec/features/todos/todos_filtering_spec.rb b/spec/features/todos/todos_filtering_spec.rb
index b9e66243d84..d1f2bc78884 100644
--- a/spec/features/todos/todos_filtering_spec.rb
+++ b/spec/features/todos/todos_filtering_spec.rb
@@ -36,17 +36,54 @@ describe 'Dashboard > User filters todos', feature: true, js: true do
expect(page).not_to have_content project_2.name_with_namespace
end
- it 'filters by author' do
- click_button 'Author'
- within '.dropdown-menu-author' do
- fill_in 'Search authors', with: user_1.name
- click_link user_1.name
+ context "Author filter" do
+ it 'filters by author' do
+ click_button 'Author'
+
+ within '.dropdown-menu-author' do
+ fill_in 'Search authors', with: user_1.name
+ click_link user_1.name
+ end
+
+ wait_for_ajax
+
+ expect(find('.todos-list')).to have_content user_1.name
+ expect(find('.todos-list')).not_to have_content user_2.name
end
- wait_for_ajax
+ it "shows only authors of existing todos" do
+ click_button 'Author'
+
+ within '.dropdown-menu-author' do
+ # It should contain two users + "Any Author"
+ expect(page).to have_selector('.dropdown-menu-user-link', count: 3)
+ expect(page).to have_content(user_1.name)
+ expect(page).to have_content(user_2.name)
+ end
+ end
- expect(find('.todos-list')).to have_content user_1.name
- expect(find('.todos-list')).not_to have_content user_2.name
+ it "shows only authors of existing done todos" do
+ user_3 = create :user
+ user_4 = create :user
+ create(:todo, user: user_1, author: user_3, project: project_1, target: issue, action: 1, state: :done)
+ create(:todo, user: user_1, author: user_4, project: project_2, target: merge_request, action: 2, state: :done)
+
+ project_1.team << [user_3, :developer]
+ project_2.team << [user_4, :developer]
+
+ visit dashboard_todos_path(state: 'done')
+
+ click_button 'Author'
+
+ within '.dropdown-menu-author' do
+ # It should contain two users + "Any Author"
+ expect(page).to have_selector('.dropdown-menu-user-link', count: 3)
+ expect(page).to have_content(user_3.name)
+ expect(page).to have_content(user_4.name)
+ expect(page).not_to have_content(user_1.name)
+ expect(page).not_to have_content(user_2.name)
+ end
+ end
end
it 'filters by type' do