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