diff options
-rw-r--r-- | app/serializers/commit_entity.rb | 8 | ||||
-rw-r--r-- | changelogs/unreleased/fix-serialized-commit-path.yml | 4 | ||||
-rw-r--r-- | spec/serializers/commit_entity_spec.rb | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/app/serializers/commit_entity.rb b/app/serializers/commit_entity.rb index 49f4db36295..31763955f97 100644 --- a/app/serializers/commit_entity.rb +++ b/app/serializers/commit_entity.rb @@ -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 diff --git a/changelogs/unreleased/fix-serialized-commit-path.yml b/changelogs/unreleased/fix-serialized-commit-path.yml new file mode 100644 index 00000000000..4e4df503874 --- /dev/null +++ b/changelogs/unreleased/fix-serialized-commit-path.yml @@ -0,0 +1,4 @@ +--- +title: Fix links to commits pages on pipelines list page +merge_request: 8558 +author: diff --git a/spec/serializers/commit_entity_spec.rb b/spec/serializers/commit_entity_spec.rb index a8662e81d20..0333d73b5b5 100644 --- a/spec/serializers/commit_entity_spec.rb +++ b/spec/serializers/commit_entity_spec.rb @@ -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 |