diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-22 14:19:43 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-22 14:19:43 +0300 |
commit | e0c07b5e3d1e14fa6efda3c13db46477d79c7c34 (patch) | |
tree | 94273ec51b61e9550650d026a70c48f01924cbb3 /spec/features | |
parent | c9fe9f59d27bacb60c264678cce3cbe45d514a69 (diff) |
Add tests for filtering owned projects
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/dashboard/user_filters_projects_spec.rb | 27 | ||||
-rw-r--r-- | spec/features/dashboard_filter_spec.rb | 30 |
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 |