Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
0f79620c
Commit
0f79620c
authored
Jan 21, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Little refactor plus some specs.
parent
4d345bc4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
12 deletions
+52
-12
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+6
-12
features/dashboard/dashboard.feature
features/dashboard/dashboard.feature
+16
-0
features/project/issues/issues.feature
features/project/issues/issues.feature
+8
-0
features/project/merge_requests.feature
features/project/merge_requests.feature
+8
-0
features/steps/dashboard/dashboard.rb
features/steps/dashboard/dashboard.rb
+1
-0
features/steps/shared/issuable.rb
features/steps/shared/issuable.rb
+13
-0
No files found.
app/controllers/application_controller.rb
View file @
0f79620c
...
...
@@ -410,18 +410,12 @@ class ApplicationController < ActionController::Base
def
set_default_sort
controller_name
=
params
[
:controller
].
sub
(
/Controller\Z/
,
''
).
underscore
cookie_suffix
=
"_sort_
#{
controller_name
}
"
key
=
if
@project
"
#{
@project
.
cookie_key
}#{
cookie_suffix
}
"
elsif
@group
"
#{
@group
.
cookie_key
}#{
cookie_suffix
}
"
else
"
#{
current_user
.
cookie_key
}#{
cookie_suffix
}
"
end
cookies
[
key
]
||=
'id_desc'
cookies
[
key
]
=
params
[
:sort
]
if
params
[
:sort
].
present?
cookie_suffix
=
"_sort_
#{
controller_name
}
"
key
=
"
#{
(
@project
||
@group
||
current_user
).
cookie_key
}#{
cookie_suffix
}
"
cookies
[
key
]
||=
'id_desc'
cookies
[
key
]
=
params
[
:sort
]
if
params
[
:sort
].
present?
params
[
:sort
]
=
cookies
[
key
]
end
end
features/dashboard/dashboard.feature
View file @
0f79620c
...
...
@@ -41,3 +41,19 @@ Feature: Dashboard
And
user with name
"John Doe"
left project
"Shop"
When
I visit dashboard activity page
Then
I should see
"John Doe left project Shop"
event
@javascript
Scenario
:
Sorting Issues
Given
I visit dashboard issues page
And
I sort the list by
"Oldest updated"
And
I visit dashboard activity page
And
I visit dashboard issues page
Then
The list should be sorted by
"Oldest updated"
@javascript
Scenario
:
Sorting Merge Requests
Given
I visit dashboard merge requests page
And
I sort the list by
"Oldest updated"
And
I visit dashboard activity page
And
I visit dashboard merge requests page
Then
The list should be sorted by
"Oldest updated"
features/project/issues/issues.feature
View file @
0f79620c
...
...
@@ -59,6 +59,14 @@ Feature: Project Issues
And
I sort the list by
"Last updated"
Then
I should see
"Release 0.4"
at the top
@javascript
Scenario
:
Visiting Issues after being sorted the list
Given
I visit project
"Shop"
issues page
And
I sort the list by
"Oldest updated"
And
I visit my project's home page
And
I visit project
"Shop"
issues page
Then
The list should be sorted by
"Oldest updated"
@javascript
Scenario
:
I
search issue
Given
I fill in issue search with
"Re"
...
...
features/project/merge_requests.feature
View file @
0f79620c
...
...
@@ -84,6 +84,14 @@ Feature: Project Merge Requests
And
I sort the list by
"Last updated"
Then
I should see
"Bug NS-04"
at the top
@javascript
Scenario
:
Visiting Merge Requests after being sorted the list
Given
I visit project
"Shop"
merge requests page
And
I sort the list by
"Oldest updated"
And
I visit my project's home page
And
I visit project
"Shop"
merge requests page
Then
The list should be sorted by
"Oldest updated"
@javascript
Scenario
:
Visiting Merge Requests after commenting on diffs
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
...
...
features/steps/dashboard/dashboard.rb
View file @
0f79620c
...
...
@@ -2,6 +2,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedProject
include
SharedIssuable
step
'I should see "New Project" link'
do
expect
(
page
).
to
have_link
"New project"
...
...
features/steps/shared/issuable.rb
View file @
0f79620c
...
...
@@ -106,6 +106,19 @@ module SharedIssuable
edit_issuable
end
step
'I sort the list by "Oldest updated"'
do
find
(
'button.dropdown-toggle.btn'
).
click
page
.
within
(
'ul.dropdown-menu.dropdown-menu-align-right li'
)
do
click_link
"Oldest updated"
end
end
step
'The list should be sorted by "Oldest updated"'
do
page
.
within
(
'div.dropdown.inline.prepend-left-10'
)
do
expect
(
page
.
find
(
'button.dropdown-toggle.btn'
)).
to
have_content
(
'Oldest updated'
)
end
end
def
create_issuable_for_project
(
project_name
:,
title
:,
type: :issue
)
project
=
Project
.
find_by
(
name:
project_name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment