Commit c56ae831 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'issue_3799' into 'master'

Add tests for filtering owned projects

REF: #3799

See merge request !3873
parents a600b4b1 21a1e156
require 'spec_helper' require 'spec_helper'
describe "Dashboard projects filters", feature: true, js: true do describe "Dashboard > User filters projects", feature: true do
context 'filtering personal projects' do describe 'filtering personal projects' do
before do before do
user = create(:user) user = create(:user)
project = create(:project, name: "Victorialand", namespace: user.namespace) project = create(:project, name: "Victorialand", namespace: user.namespace)
project.team << [user, :master] project.team << [user, :master]
user2 = create(:user)
project2 = create(:project, name: "Treasure", namespace: user2.namespace)
project2.team << [user, :developer]
login_as(user) login_as(user)
visit dashboard_projects_path visit dashboard_projects_path
open_filter_dropdown
click_link "Owned by me"
end end
it 'filters by projects "Owned by me"' do it 'filters by projects "Owned by me"' do
sleep 1 click_link "Owned by me"
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 expect(page).to have_css('.is-active', text: 'Owned by me')
find('button.dropdown-toggle.btn').click expect(page).to have_content('Victorialand')
expect(page).not_to have_content('Treasure')
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment