diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-03 13:28:08 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-03 13:28:08 +0100 |
commit | fc5afc60ace366fd010f1df1484d2f048c162a7b (patch) | |
tree | aa775b6413682508808c8743aea3cbe7dae56a92 /spec/controllers/admin/impersonation_controller_spec.rb | |
parent | 37ab1120c8a252aa29702ef141ff4ea1163e0e75 (diff) | |
parent | 6689224a90f3d2500be5d927ea1ed9656fc7b1b6 (diff) | |
download | gitlab-ce-ui/new-project.tar.gz |
Merge branch 'master' into ui/new-projectui/new-project
Diffstat (limited to 'spec/controllers/admin/impersonation_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin/impersonation_controller_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/controllers/admin/impersonation_controller_spec.rb b/spec/controllers/admin/impersonation_controller_spec.rb new file mode 100644 index 00000000000..d7a7ba1c5b6 --- /dev/null +++ b/spec/controllers/admin/impersonation_controller_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe Admin::ImpersonationController do + let(:admin) { create(:admin) } + + before do + sign_in(admin) + end + + describe 'CREATE #impersonation when blocked' do + let(:blocked_user) { create(:user, state: :blocked) } + + it 'does not allow impersonation' do + post :create, id: blocked_user.username + + expect(flash[:alert]).to eq 'You cannot impersonate a blocked user' + end + end +end |