summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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