debian-mirror-gitlab/spec/views/admin/users/_user.html.haml_spec.rb

42 lines
911 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# 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