diff options
author | zs <baloghzsof@gmail.com> | 2016-07-24 02:28:12 +0300 |
---|---|---|
committer | zs <baloghzsof@gmail.com> | 2016-08-01 12:28:56 +0300 |
commit | 84a3225b0cde0ed2e343864583e7b79d7118e05c (patch) | |
tree | 9712cf393a1f2e6b0a252659dfe171cb07b05e71 /spec/features/issues_spec.rb | |
parent | 242f8377264973d642b46e5d2800ef3d3bd4c0fa (diff) |
State specific default sort order for issuables
Provide more sensible default sort order for issues and merge requests
based on the following table:
| type | state | default sort order |
|----------------|--------|--------------------|
| issues | open | last created |
| issues | closed | last updated |
| issues | all | last created |
| merge requests | open | last created |
| merge requests | merged | last updated |
| merge requests | closed | last updated |
| merge requests | all | last created |
Diffstat (limited to 'spec/features/issues_spec.rb')
-rw-r--r-- | spec/features/issues_spec.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 93dcb2ec3fc..9c92b52898c 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' describe 'Issues', feature: true do + include IssueHelpers include SortingHelper let(:project) { create(:project) } @@ -186,15 +187,15 @@ describe 'Issues', feature: true do it 'sorts by newest' do visit namespace_project_issues_path(project.namespace, project, sort: sort_value_recently_created) - expect(first_issue).to include('baz') - expect(last_issue).to include('foo') + expect(first_issue).to include('foo') + expect(last_issue).to include('baz') end it 'sorts by oldest' do visit namespace_project_issues_path(project.namespace, project, sort: sort_value_oldest_created) - expect(first_issue).to include('foo') - expect(last_issue).to include('baz') + expect(first_issue).to include('baz') + expect(last_issue).to include('foo') end it 'sorts by most recently updated' do @@ -350,8 +351,8 @@ describe 'Issues', feature: true do sort: sort_value_oldest_created, assignee_id: user2.id) - expect(first_issue).to include('foo') - expect(last_issue).to include('bar') + expect(first_issue).to include('bar') + expect(last_issue).to include('foo') expect(page).not_to have_content 'baz' end end @@ -590,14 +591,6 @@ describe 'Issues', feature: true do end end - def first_issue - page.all('ul.issues-list > li').first.text - end - - def last_issue - page.all('ul.issues-list > li').last.text - end - def drop_in_dropzone(file_path) # Generate a fake input selector page.execute_script <<-JS |