Update commit entity to point to valid commit page
This commit is contained in:
parent
4b43126d08
commit
1f546e4d72
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue