Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-08-19 01:16:06 +0300
committerSean McGivern <sean@gitlab.com>2016-08-19 01:26:07 +0300
commitd3acded4bcb176472be5fdfe03a4bff55f39bdac (patch)
tree5a6d64e7684a143ef4082ea20e567ede0c60cb31 /spec/features/issuables
parent717366d28da11acc6dbe60301bf7e2394400b3c1 (diff)
Handle legacy sort order values
The sort orders used to be id_asc / id_desc, and are now created_asc / created_desc. Users can still have cookies containing the old sort orders, or bookmarks to links specifying them, so convert these to the new versions quietly.
Diffstat (limited to 'spec/features/issuables')
-rw-r--r--spec/features/issuables/default_sort_order_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/issuables/default_sort_order_spec.rb b/spec/features/issuables/default_sort_order_spec.rb
index 9114f751b55..9a2b879e789 100644
--- a/spec/features/issuables/default_sort_order_spec.rb
+++ b/spec/features/issuables/default_sort_order_spec.rb
@@ -149,6 +149,30 @@ describe 'Projects > Issuables > Default sort order', feature: true do
expect(last_issue).to include(first_created_issuable.title)
end
end
+
+ context 'when the sort in the URL is id_desc' do
+ let(:issuable_type) { :issue }
+
+ before { visit_issues(project, sort: 'id_desc') }
+
+ it 'shows the sort order as last created' do
+ expect(find('.issues-other-filters')).to have_content('Last created')
+ expect(first_issue).to include(last_created_issuable.title)
+ expect(last_issue).to include(first_created_issuable.title)
+ end
+ end
+
+ context 'when the sort in the URL is id_asc' do
+ let(:issuable_type) { :issue }
+
+ before { visit_issues(project, sort: 'id_asc') }
+
+ it 'shows the sort order as oldest created' do
+ expect(find('.issues-other-filters')).to have_content('Oldest created')
+ expect(first_issue).to include(first_created_issuable.title)
+ expect(last_issue).to include(last_created_issuable.title)
+ end
+ end
end
def selected_sort_order