summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-04-22 15:11:14 +0000
committerRémy Coutable <remy@rymai.me>2016-04-22 15:11:14 +0000
commitc56ae831db3952b659c10565c32dcc3c89efd5ff (patch)
tree2ed2a1170378df2c0b2097e7daecc0709b07ed47
parenta600b4b1c08c374e336cbd4226d2ff77c8ff9cca (diff)
parent21a1e1567784809b8773bb7c48ae33a1a42f73dc (diff)
downloadgitlab-ce-c56ae831db3952b659c10565c32dcc3c89efd5ff.tar.gz
Merge branch 'issue_3799' into 'master'
Add tests for filtering owned projects REF: #3799 See merge request !3873
-rw-r--r--spec/features/dashboard/user_filters_projects_spec.rb27
-rw-r--r--spec/features/dashboard_filter_spec.rb30
2 files changed, 27 insertions, 30 deletions
diff --git a/spec/features/dashboard/user_filters_projects_spec.rb b/spec/features/dashboard/user_filters_projects_spec.rb
new file mode 100644
index 00000000000..cf86e2c85e9
--- /dev/null
+++ b/spec/features/dashboard/user_filters_projects_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+describe "Dashboard > User filters projects", feature: true do
+
+ describe 'filtering personal projects' do
+ before do
+ user = create(:user)
+ project = create(:project, name: "Victorialand", namespace: user.namespace)
+ project.team << [user, :master]
+
+ user2 = create(:user)
+ project2 = create(:project, name: "Treasure", namespace: user2.namespace)
+ project2.team << [user, :developer]
+
+ login_as(user)
+ visit dashboard_projects_path
+ end
+
+ it 'filters by projects "Owned by me"' do
+ click_link "Owned by me"
+
+ expect(page).to have_css('.is-active', text: 'Owned by me')
+ expect(page).to have_content('Victorialand')
+ expect(page).not_to have_content('Treasure')
+ end
+ end
+end
diff --git a/spec/features/dashboard_filter_spec.rb b/spec/features/dashboard_filter_spec.rb
deleted file mode 100644
index 3d20813161a..00000000000
--- a/spec/features/dashboard_filter_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'spec_helper'
-
-describe "Dashboard projects filters", feature: true, js: true do
-
- context 'filtering personal projects' do
- before do
- user = create(:user)
- project = create(:project, name: "Victorialand", namespace: user.namespace)
- project.team << [user, :master]
-
- login_as(user)
- visit dashboard_projects_path
-
- open_filter_dropdown
- click_link "Owned by me"
- end
-
- it 'filters by projects "Owned by me"' do
- sleep 1
- open_filter_dropdown
- page.within('ul.dropdown-menu.dropdown-menu-align-right') do
- expect(page).to have_css('.is-active', text: 'Owned by me')
- end
- end
- end
-
- def open_filter_dropdown
- find('button.dropdown-toggle.btn').click
- end
-end