Skip to content
Snippets Groups Projects
Commit b1f5af40 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

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

parent 43898f8e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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,
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment