Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-13 15:07:32 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-13 15:07:32 +0300
commit1f546e4d724d77db0a384fb36e17243bf75381f5 (patch)
tree9851f4f5b73d72a4747c2d5ea0602441b3aadd56
parent4b43126d08972c201551fbd1fe42e85847d5e03f (diff)
Update commit entity to point to valid commit page
-rw-r--r--app/serializers/commit_entity.rb8
-rw-r--r--spec/serializers/commit_entity_spec.rb2
2 files changed, 6 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/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