diff options
Diffstat (limited to 'spec/features/dashboard/issues_spec.rb')
-rw-r--r-- | spec/features/dashboard/issues_spec.rb | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/spec/features/dashboard/issues_spec.rb b/spec/features/dashboard/issues_spec.rb index 4ae062f242a..9957bec0f0b 100644 --- a/spec/features/dashboard/issues_spec.rb +++ b/spec/features/dashboard/issues_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' RSpec.describe 'Dashboard Issues' do + include FilteredSearchHelpers + let(:current_user) { create :user } let(:user) { current_user } # Shared examples depend on this being available let!(:public_project) { create(:project, :public) } @@ -14,7 +16,7 @@ RSpec.describe 'Dashboard Issues' do before do [project, project_with_issues_disabled].each { |project| project.add_maintainer(current_user) } sign_in(current_user) - visit issues_dashboard_path(assignee_id: current_user.id) + visit issues_dashboard_path(assignee_username: current_user.username) end describe 'issues' do @@ -24,26 +26,9 @@ RSpec.describe 'Dashboard Issues' do expect(page).not_to have_content(other_issue.title) end - it 'shows checkmark when unassigned is selected for assignee', :js do - find('.js-assignee-search').click - find('li', text: 'Unassigned').click - find('.js-assignee-search').click - - expect(find('li[data-user-id="0"] a.is-active')).to be_visible - end - it 'shows issues when current user is author', :js do - execute_script("document.querySelector('#assignee_id').value=''") - find('.js-author-search', match: :first).click - - expect(find('li[data-user-id="null"] a.is-active')).to be_visible - - find('.dropdown-menu-author li a', match: :first, text: current_user.to_reference).click - find('.js-author-search', match: :first).click - - page.within '.dropdown-menu-user' do - expect(find('.dropdown-menu-author li a.is-active', match: :first, text: current_user.to_reference)).to be_visible - end + reset_filters + input_filtered_search("author:#{current_user.to_reference}") expect(page).to have_content(authored_issue.title) expect(page).to have_content(authored_issue_on_public_project.title) @@ -53,7 +38,7 @@ RSpec.describe 'Dashboard Issues' do it 'state filter tabs work' do find('#state-closed').click - expect(page).to have_current_path(issues_dashboard_url(assignee_id: current_user.id, state: 'closed'), url: true) + expect(page).to have_current_path(issues_dashboard_url(assignee_username: current_user.username, state: 'closed'), url: true) end it_behaves_like "it has an RSS button with current_user's feed token" |