mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FEATURE: Make initial admins TL1
* Match register controller TL to rake admin:create * Don't promote if trust_level > 1
This commit is contained in:
parent
5a6d1ee257
commit
cdea969c6a
@ -27,6 +27,7 @@ class FinishInstallationController < ApplicationController
|
||||
@user.password_required!
|
||||
|
||||
if @user.save
|
||||
@user.change_trust_level!(1) if @user.trust_level < 1
|
||||
send_signup_email
|
||||
return redirect_confirm(@user.email)
|
||||
end
|
||||
|
@ -102,6 +102,15 @@ describe FinishInstallationController do
|
||||
end
|
||||
end
|
||||
|
||||
it "sets the admins trust level" do
|
||||
post "/finish-installation/register.json", params: {
|
||||
email: 'robin@example.com',
|
||||
username: 'eviltrout',
|
||||
password: 'disismypasswordokay'
|
||||
}
|
||||
|
||||
expect(User.find_by(username: 'eviltrout').trust_level).to eq 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user