diff options
Diffstat (limited to 'spec/features/merge_requests')
-rw-r--r-- | spec/features/merge_requests/user_lists_merge_requests_spec.rb | 14 | ||||
-rw-r--r-- | spec/features/merge_requests/user_sorts_merge_requests_spec.rb | 29 |
2 files changed, 16 insertions, 27 deletions
diff --git a/spec/features/merge_requests/user_lists_merge_requests_spec.rb b/spec/features/merge_requests/user_lists_merge_requests_spec.rb index 8c1d9dd38b0..2743f7e8ed4 100644 --- a/spec/features/merge_requests/user_lists_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_lists_merge_requests_spec.rb @@ -109,7 +109,7 @@ RSpec.describe 'Merge requests > User lists merge requests' do expect(count_merge_requests).to eq(4) end - it 'sorts by milestone' do + it 'sorts by milestone due date' do visit_merge_requests(project, sort: sort_value_milestone) expect(first_merge_request).to include('fix') @@ -130,12 +130,12 @@ RSpec.describe 'Merge requests > User lists merge requests' do expect(count_merge_requests).to eq(4) end - it 'filters on one label and sorts by due date' do + it 'filters on one label and sorts by milestone due date' do label = create(:label, project: project) create(:label_link, label: label, target: @fix) visit_merge_requests(project, label_name: [label.name], - sort: sort_value_due_date) + sort: sort_value_milestone) expect(first_merge_request).to include('fix') expect(count_merge_requests).to eq(1) @@ -150,19 +150,19 @@ RSpec.describe 'Merge requests > User lists merge requests' do create(:label_link, label: label2, target: @fix) end - it 'sorts by due date' do + it 'sorts by milestone due date' do visit_merge_requests(project, label_name: [label.name, label2.name], - sort: sort_value_due_date) + sort: sort_value_milestone) expect(first_merge_request).to include('fix') expect(count_merge_requests).to eq(1) end context 'filter on assignee and' do - it 'sorts by due soon' do + it 'sorts by milestone due date' do visit_merge_requests(project, label_name: [label.name, label2.name], assignee_id: user.id, - sort: sort_value_due_date) + sort: sort_value_milestone) expect(first_merge_request).to include('fix') expect(count_merge_requests).to eq(1) diff --git a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb index 99473f3b1ea..8f6103c259b 100644 --- a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb @@ -2,8 +2,9 @@ require 'spec_helper' -RSpec.describe 'User sorts merge requests' do +RSpec.describe 'User sorts merge requests', :js do include CookieHelper + include Spec::Support::Helpers::Features::SortingHelpers let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let!(:merge_request2) do @@ -22,23 +23,19 @@ RSpec.describe 'User sorts merge requests' do end it 'keeps the sort option' do - find('.filter-dropdown-container .dropdown').click - - page.within('ul.dropdown-menu.dropdown-menu-right li') do - click_link('Milestone') - end + pajamas_sort_by(s_('SortOptions|Milestone')) visit(merge_requests_dashboard_path(assignee_username: user.username)) - expect(find('.issues-filters a.is-active')).to have_content('Milestone') + expect(find('.filter-dropdown-container button.dropdown-toggle')).to have_content('Milestone') visit(project_merge_requests_path(project)) - expect(find('.issues-filters a.is-active')).to have_content('Milestone') + expect(find('.filter-dropdown-container button.dropdown-toggle')).to have_content('Milestone') visit(merge_requests_group_path(group)) - expect(find('.issues-filters a.is-active')).to have_content('Milestone') + expect(find('.filter-dropdown-container button.dropdown-toggle')).to have_content('Milestone') end it 'fallbacks to issuable_sort cookie key when remembering the sorting option' do @@ -46,17 +43,13 @@ RSpec.describe 'User sorts merge requests' do visit(merge_requests_dashboard_path(assignee_username: user.username)) - expect(find('.issues-filters a.is-active')).to have_content('Milestone') + expect(find('.filter-dropdown-container button.dropdown-toggle')).to have_content('Milestone') end it 'separates remember sorting with issues' do create(:issue, project: project) - find('.filter-dropdown-container .dropdown').click - - page.within('ul.dropdown-menu.dropdown-menu-right li') do - click_link('Milestone') - end + pajamas_sort_by(s_('SortOptions|Milestone')) visit(project_issues_path(project)) @@ -73,11 +66,7 @@ RSpec.describe 'User sorts merge requests' do end it 'sorts by popularity' do - find('.filter-dropdown-container .dropdown').click - - page.within('ul.dropdown-menu.dropdown-menu-right li') do - click_link('Popularity') - end + pajamas_sort_by(s_('SortOptions|Popularity')) page.within('.mr-list') do page.within('li.merge-request:nth-child(1)') do |