BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
08d21fe8
Unverified
Commit
08d21fe8
authored
Nov 08, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add small improvements to constrainers and specs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
82e551bd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
group_url_constrainer.rb
lib/constraints/group_url_constrainer.rb
+1
-1
user_url_constrainer.rb
lib/constraints/user_url_constrainer.rb
+1
-1
group_url_constrainer_spec.rb
spec/lib/constraints/group_url_constrainer_spec.rb
+1
-1
user_url_constrainer_spec.rb
spec/lib/constraints/user_url_constrainer_spec.rb
+1
-1
No files found.
lib/constraints/group_url_constrainer.rb
View file @
08d21fe8
...
...
@@ -7,7 +7,7 @@ class GroupUrlConstrainer
id
=
extract_resource_path
(
request
.
path
)
if
id
=~
Gitlab
::
Regex
.
namespace_regex
!!
Group
.
find_by_path
(
id
)
Group
.
find_by
(
path:
id
).
present?
else
false
end
...
...
lib/constraints/user_url_constrainer.rb
View file @
08d21fe8
...
...
@@ -7,7 +7,7 @@ class UserUrlConstrainer
id
=
extract_resource_path
(
request
.
path
)
if
id
=~
Gitlab
::
Regex
.
namespace_regex
!!
User
.
find_by
(
'lower(username) = ?'
,
id
.
downcase
)
User
.
find_by
(
'lower(username) = ?'
,
id
.
downcase
).
present?
else
false
end
...
...
spec/lib/constraints/group_url_constrainer_spec.rb
View file @
08d21fe8
...
...
@@ -14,6 +14,6 @@ describe GroupUrlConstrainer, lib: true do
end
def
request
(
path
)
OpenStruct
.
new
(
path:
path
)
double
(
:request
,
path:
path
)
end
end
spec/lib/constraints/user_url_constrainer_spec.rb
View file @
08d21fe8
...
...
@@ -11,6 +11,6 @@ describe UserUrlConstrainer, lib: true do
end
def
request
(
path
)
OpenStruct
.
new
(
path:
path
)
double
(
:request
,
path:
path
)
end
end
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