summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArinde Eniola <eniolaarinde1@gmail.com>2016-04-06 02:50:01 +0100
committerArinde Eniola <eniolaarinde1@gmail.com>2016-04-06 02:50:01 +0100
commit55b2fae327854be6ab0789dbdf92f4265207680f (patch)
treeab814be70b6c91e5ffbdb56308bc6b3d26d541e5
parentdb8836ca84ab86dc39b4d8b3282603c724a78e67 (diff)
downloadgitlab-ce-55b2fae327854be6ab0789dbdf92f4265207680f.tar.gz
set up test for preventing this issue from reoccuring
-rw-r--r--spec/features/issues/filter_issues_spec.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/features/issues/filter_issues_spec.rb b/spec/features/issues/filter_issues_spec.rb
new file mode 100644
index 00000000000..78841213536
--- /dev/null
+++ b/spec/features/issues/filter_issues_spec.rb
@@ -0,0 +1,45 @@
+require 'rails_helper'
+
+describe 'Filter issues', feature: true do
+
+ let!(:project) { create(:project) }
+ let!(:issue) { create(:issue, project: project) }
+ let!(:user) { create(:user)}
+
+ before do
+ project.team << [user, :master]
+ login_as(user)
+ end
+
+ describe 'Filter issues for assignee from issues#index' do
+
+ before do
+ visit namespace_project_issues_path(project.namespace, project)
+
+ find('.js-assignee-search').click
+
+ find('.dropdown-menu-user-link', text: user.username).click
+
+ sleep 2
+ end
+
+ context 'assignee', js: true do
+ it 'should update to current user' do
+ expect(find('.js-assignee-search .dropdown-toggle-text')).to have_content(user.name)
+ end
+
+ it 'should not change when closed link is clicked' do
+ find('.issues-state-filters a', text: "Closed").click
+
+ expect(find('.js-assignee-search .dropdown-toggle-text')).to have_content(user.name)
+ end
+
+
+ it 'should not change when all link is clicked' do
+ find('.issues-state-filters a', text: "All").click
+
+ expect(find('.js-assignee-search .dropdown-toggle-text')).to have_content(user.name)
+ end
+ end
+ end
+end