Commit 876632b6 authored by Stan Hu's avatar Stan Hu

Merge branch 'ph/207723/userTypeGravatarDisabled' into 'master'

Fixed last commit widget not showing with Gravatar disabled

Closes #207723

See merge request gitlab-org/gitlab!25800
parents 73fcf8ee 0489b9c7
......@@ -14,7 +14,7 @@ module Types
description: 'Human-readable name of the user'
field :username, GraphQL::STRING_TYPE, null: false,
description: 'Username of the user. Unique within this instance of GitLab'
field :avatar_url, GraphQL::STRING_TYPE, null: false,
field :avatar_url, GraphQL::STRING_TYPE, null: true,
description: "URL of the user's avatar"
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the user'
......
---
title: Fixed last commit widget when Gravatar is disabled
merge_request:
author:
type: fixed
......@@ -8003,7 +8003,7 @@ type User {
"""
URL of the user's avatar
"""
avatarUrl: String!
avatarUrl: String
"""
Human-readable name of the user
......
......@@ -6171,13 +6171,9 @@
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
......
......@@ -1287,7 +1287,7 @@ Autogenerated return type of UpdateSnippet
| Name | Type | Description |
| --- | ---- | ---------- |
| `avatarUrl` | String! | URL of the user's avatar |
| `avatarUrl` | String | URL of the user's avatar |
| `name` | String! | Human-readable name of the user |
| `userPermissions` | UserPermissions! | Permissions for the current user on the resource |
| `username` | String! | Username of the user. Unique within this instance of GitLab |
......
......@@ -5,11 +5,14 @@ require 'spec_helper'
describe 'Projects tree', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:gravatar_enabled) { true }
# This commit has a known state on the master branch of gitlab-test
let(:test_sha) { '7975be0116940bf2ad4321f79d02a55c5f7779aa' }
before do
stub_application_setting(gravatar_enabled: gravatar_enabled)
project.add_maintainer(user)
sign_in(user)
end
......@@ -34,6 +37,20 @@ describe 'Projects tree', :js do
expect(page).not_to have_selector('.flash-alert')
end
context 'gravatar disabled' do
let(:gravatar_enabled) { false }
it 'renders last commit' do
visit project_tree_path(project, test_sha)
wait_for_requests
page.within('.project-last-commit') do
expect(page).to have_selector('.user-avatar-link')
expect(page).to have_content('Merge branch')
end
end
end
context 'for signed commit' do
it 'displays a GPG badge' do
visit project_tree_path(project, '33f3729a45c02fc67d00adb1b8bca394b0e761d9')
......
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