Commit 1f546e4d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Update commit entity to point to valid commit page

parent 4b43126d
...@@ -8,16 +8,16 @@ class CommitEntity < API::Entities::RepoCommit ...@@ -8,16 +8,16 @@ class CommitEntity < API::Entities::RepoCommit
end end
expose :commit_url do |commit| expose :commit_url do |commit|
namespace_project_tree_url( namespace_project_commit_url(
request.project.namespace, request.project.namespace,
request.project, request.project,
id: commit.id) commit)
end end
expose :commit_path do |commit| expose :commit_path do |commit|
namespace_project_tree_path( namespace_project_commit_path(
request.project.namespace, request.project.namespace,
request.project, request.project,
id: commit.id) commit)
end end
end end
...@@ -33,10 +33,12 @@ describe CommitEntity do ...@@ -33,10 +33,12 @@ describe CommitEntity do
it 'contains path to commit' do it 'contains path to commit' do
expect(subject).to include(:commit_path) expect(subject).to include(:commit_path)
expect(subject[:commit_path]).to include "commit/#{commit.id}"
end end
it 'contains URL to commit' do it 'contains URL to commit' do
expect(subject).to include(:commit_url) expect(subject).to include(:commit_url)
expect(subject[:commit_path]).to include "commit/#{commit.id}"
end end
it 'needs to receive project in the request' do it 'needs to receive project in the request' do
......
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