提交 0541bffa 编写于 作者: G Grzegorz Bizon

Expose commit author's gravatar if not gitlab user

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册