summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-06-19 11:21:25 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-06-19 11:21:25 +0000
commitff97afdd589b0c3dd93db9eca83b13a09a704a2e (patch)
tree896a5b2389b0eb80b31e499b3efdac352e1fed5b
parent7794a5157ca3e29826e344c90e23601c9bc9e357 (diff)
parentaa2e2cacb46485eae1356ba9cf684bbf2bb41d42 (diff)
downloadgitlab-ce-ff97afdd589b0c3dd93db9eca83b13a09a704a2e.tar.gz
Merge branch '33461-display-user-id' into 'master'
Display own user id in account settings pages Closes #33461 See merge request !12141
-rw-r--r--app/views/profiles/show.html.haml15
-rw-r--r--changelogs/unreleased/33461-display-user-id.yml4
-rw-r--r--spec/views/profiles/show.html.haml_spec.rb19
3 files changed, 34 insertions, 4 deletions
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index fcfd350f0da..15672289c65 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -42,10 +42,17 @@
- if current_user.ldap_user?
Some options are unavailable for LDAP accounts
.col-lg-9
- .form-group
- = f.label :name, class: "label-light"
- = f.text_field :name, class: "form-control", required: true
- %span.help-block Enter your name, so people you know can recognize you.
+ .row
+ .form-group.col-md-9
+ = f.label :name, class: "label-light"
+ = f.text_field :name, class: "form-control", required: true
+ %span.help-block Enter your name, so people you know can recognize you.
+
+ .form-group.col-md-3
+ = f.label :id, class: 'label-light' do
+ User ID
+ = f.text_field :id, class: 'form-control', readonly: true
+
.form-group
= f.label :email, class: "label-light"
diff --git a/changelogs/unreleased/33461-display-user-id.yml b/changelogs/unreleased/33461-display-user-id.yml
new file mode 100644
index 00000000000..cba94625b07
--- /dev/null
+++ b/changelogs/unreleased/33461-display-user-id.yml
@@ -0,0 +1,4 @@
+---
+title: Display own user id in account settings page
+merge_request: 12141
+author: Riccardo Padovani
diff --git a/spec/views/profiles/show.html.haml_spec.rb b/spec/views/profiles/show.html.haml_spec.rb
new file mode 100644
index 00000000000..e89a8cb9626
--- /dev/null
+++ b/spec/views/profiles/show.html.haml_spec.rb
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe 'profiles/show' do
+ let(:user) { create(:user) }
+
+ before do
+ assign(:user, user)
+ allow(controller).to receive(:current_user).and_return(user)
+ end
+
+ context 'when the profile page is opened' do
+ it 'displays the correct elements' do
+ render
+
+ expect(rendered).to have_field('user_name', user.name)
+ expect(rendered).to have_field('user_id', user.id)
+ end
+ end
+end