BigW Consortium Gitlab

Commit 0541bffa by Grzegorz Bizon

Expose commit author's gravatar if not gitlab user

parent 6186ac2c
......@@ -3,6 +3,10 @@ class CommitEntity < API::Entities::RepoCommit
expose :author, using: UserEntity
expose :author_gravatar_url do |commit|
GravatarService.new.execute(commit.author_email)
end
expose :commit_url do |commit|
namespace_project_tree_url(
request.project.namespace,
......
......@@ -41,4 +41,8 @@ describe CommitEntity do
subject
end
it 'exposes gravatar url that belongs to author' do
expect(subject.fetch(:author_gravatar_url)).to match /gravatar/
end
end
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