Commit 92f5b058 authored by Valery Sizov's avatar Valery Sizov

Add ability to create a note when blocking a user

parent 408f9c3b
......@@ -148,7 +148,7 @@ class Admin::UsersController < Admin::ApplicationController
:email, :remember_me, :bio, :name, :username,
:skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :force_random_password,
:extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key, :hide_no_password,
:projects_limit, :can_create_group, :admin, :key_id
:projects_limit, :can_create_group, :admin, :key_id, :note
)
end
......
......@@ -81,6 +81,12 @@
= f.label :website_url, 'Website', class: 'control-label'
.col-sm-10= f.text_field :website_url, class: 'form-control'
%fieldset
%legend Admin notes
.form-group
= f.label :note, 'Note', class: 'control-label'
.col-sm-10= f.text_area :note, class: 'form-control'
.form-actions
- if @user.new_record?
= f.submit 'Create user', class: "btn btn-create"
......
......@@ -80,6 +80,9 @@
- else
%i.fa.fa-user.cgreen
= link_to user.name, [:admin, user]
- if user.note
= link_to "#", { "data-toggle" => "tooltip", title: user.note, class: "user-note"} do
= icon("sticky-note-o cgrey")
- if user.admin?
%strong.cred (Admin)
- if user == current_user
......
class AddNoteToUsers < ActiveRecord::Migration
def change
add_column :users, :note, :text
end
end
......@@ -63,3 +63,9 @@ Feature: Admin Users
And I visit "Pete" identities page in admin
And I remove twitter identity
Then I should not see twitter details
Scenario: Add note to user attributes
Given I visit admin users page
And click edit on my user
When I submit a note
Then I see note tooltip
......@@ -164,4 +164,15 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
step 'click on ssh keys tab' do
click_link 'SSH keys'
end
step 'I submit a note' do
@note = 'The reason to change status'
fill_in 'Note', with: @note
click_button 'Save'
end
step 'I see note tooltip' do
visit admin_users_path
expect(find(".user-note")["title"]).to have_content(@note)
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