Commit b1f5af40 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Bring back the `commit_url` as it's used by CycleAnalytics

parent 43898f8e
......@@ -3,6 +3,13 @@ class CommitEntity < API::Entities::RepoCommit
expose :author, using: UserEntity
expose :commit_url do |commit|
namespace_project_tree_url(
request.project.namespace,
request.project,
id: commit.id)
end
expose :commit_path do |commit|
namespace_project_tree_path(
request.project.namespace,
......
......@@ -35,6 +35,10 @@ describe CommitEntity do
expect(subject).to include(:commit_path)
end
it 'contains URL to commit' do
expect(subject).to include(:commit_url)
end
it 'needs to receive project in the request' do
expect(request).to receive(:project)
.and_return(project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment