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
Léo-Paul Géneau
gitlab-ce
Commits
1f546e4d
Commit
1f546e4d
authored
Jan 13, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update commit entity to point to valid commit page
parent
4b43126d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
app/serializers/commit_entity.rb
app/serializers/commit_entity.rb
+4
-4
spec/serializers/commit_entity_spec.rb
spec/serializers/commit_entity_spec.rb
+2
-0
No files found.
app/serializers/commit_entity.rb
View file @
1f546e4d
...
...
@@ -8,16 +8,16 @@ class CommitEntity < API::Entities::RepoCommit
end
expose
:commit_url
do
|
commit
|
namespace_project_
tree
_url
(
namespace_project_
commit
_url
(
request
.
project
.
namespace
,
request
.
project
,
id:
commit
.
id
)
commit
)
end
expose
:commit_path
do
|
commit
|
namespace_project_
tree
_path
(
namespace_project_
commit
_path
(
request
.
project
.
namespace
,
request
.
project
,
id:
commit
.
id
)
commit
)
end
end
spec/serializers/commit_entity_spec.rb
View file @
1f546e4d
...
...
@@ -33,10 +33,12 @@ describe CommitEntity do
it
'contains path to commit'
do
expect
(
subject
).
to
include
(
:commit_path
)
expect
(
subject
[
:commit_path
]).
to
include
"commit/
#{
commit
.
id
}
"
end
it
'contains URL to commit'
do
expect
(
subject
).
to
include
(
:commit_url
)
expect
(
subject
[
:commit_path
]).
to
include
"commit/
#{
commit
.
id
}
"
end
it
'needs to receive project in the request'
do
...
...
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