diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 21:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 21:09:17 +0300 |
commit | 0eb4fd2f32e6804bc85868ba167170238e346279 (patch) | |
tree | c020e787ea29c77e1e9f53c21940f88a87a6e905 /spec/views/admin | |
parent | 78d8830cec030ff12afed3c8ae1dddec454d0a24 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/admin')
-rw-r--r-- | spec/views/admin/users/_user.html.haml_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/views/admin/users/_user.html.haml_spec.rb b/spec/views/admin/users/_user.html.haml_spec.rb new file mode 100644 index 00000000000..96d84229d94 --- /dev/null +++ b/spec/views/admin/users/_user.html.haml_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'admin/users/_user.html.haml' do + before do + allow(view).to receive(:user).and_return(user) + end + + context 'internal users' do + context 'when showing a `Ghost User`' do + let(:user) { create(:user, ghost: true) } + + it 'does not render action buttons' do + render + + expect(rendered).not_to have_selector('.table-action-buttons') + end + end + + context 'when showing a `Bot User`' do + let(:user) { create(:user, user_type: :alert_bot) } + + it 'does not render action buttons' do + render + + expect(rendered).not_to have_selector('.table-action-buttons') + end + end + end + + context 'when showing an external user' do + let(:user) { create(:user) } + + it 'renders action buttons' do + render + + expect(rendered).to have_selector('.table-action-buttons') + end + end +end |