diff --git a/app/controllers/finish_installation_controller.rb b/app/controllers/finish_installation_controller.rb index 689150ded3e..5683724cca7 100644 --- a/app/controllers/finish_installation_controller.rb +++ b/app/controllers/finish_installation_controller.rb @@ -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 diff --git a/spec/requests/finish_installation_controller_spec.rb b/spec/requests/finish_installation_controller_spec.rb index 3c4e878490d..9801478fc60 100644 --- a/spec/requests/finish_installation_controller_spec.rb +++ b/spec/requests/finish_installation_controller_spec.rb @@ -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