Commit 67666a3c authored by Jose Ivan Vargas's avatar Jose Ivan Vargas Committed by Timothy Andrew

Added and fixed tests on the admin_users_spec.rb

parent c1870909
......@@ -533,6 +533,10 @@ class User < ActiveRecord::Base
admin
end
def is_auditor?
auditor
end
def require_ssh_key?
keys.count == 0 && Gitlab::ProtocolAccess.allowed?('ssh')
end
......
......@@ -70,7 +70,7 @@
Admin
%p.light
You cannot remove your own admin rights
-else
- else
= f.radio_button :access_level, :admin
= label_tag :admin do
Admin
......
......@@ -211,7 +211,7 @@ describe "Admin::Users", feature: true do
fill_in "user_email", with: "bigbang@mail.com"
fill_in "user_password", with: "AValidPassword1"
fill_in "user_password_confirmation", with: "AValidPassword1"
check "user_admin"
choose "user_access_level_admin"
click_button "Save changes"
end
......@@ -228,6 +228,20 @@ describe "Admin::Users", feature: true do
end
end
describe "Update user account type" do
before do
allow_any_instance_of(AuditorUserHelper).to receive(:license_allows_auditor_user?).and_return(true)
choose "user_access_level_auditor"
click_button "Save changes"
end
it "changes account type to be auditor" do
user.reload
expect(user.is_admin?).to be_falsey
expect(user.is_auditor?).to be_truthy
end
end
describe 'update username to non ascii char' do
it do
fill_in 'user_username', with: '\u3042\u3044'
......
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