From daca985a6e75d6f43c5cc5b487a0942d5bf93f68 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 1 Dec 2015 23:40:24 -0500 Subject: Prevent impersonation if blocked --- spec/features/admin/admin_users_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec/features/admin') diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 86f01faffb4..4570e409128 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -128,6 +128,16 @@ describe "Admin::Users", feature: true do expect(page).not_to have_content('Impersonate') end + + it 'should not show impersonate button for blocked user' do + another_user.block + + visit admin_user_path(another_user) + + expect(page).not_to have_content('Impersonate') + + another_user.activate + end end context 'when impersonating' do -- cgit v1.2.1