Add spec for updating reserved usernames setting
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
25a0723166
commit
df3ec9f90a
21
spec/features/admin/settings_spec.rb
Normal file
21
spec/features/admin/settings_spec.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe 'Admin/global settings', type: :feature do
|
||||||
|
let(:user) { create :user }
|
||||||
|
|
||||||
|
before do
|
||||||
|
allow(Devise::LDAP::Adapter).to receive(:get_ldap_param)
|
||||||
|
.with(user.cn, :admin).and_return(["true"])
|
||||||
|
|
||||||
|
login_as user, :scope => :user
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'Update reserved usernames' do
|
||||||
|
visit admin_settings_registrations_path
|
||||||
|
expect(Setting.reserved_usernames).not_to include(['Kosmos', 'Kredits'])
|
||||||
|
|
||||||
|
fill_in 'Reserved usernames', with: "Kosmos\nKredits"
|
||||||
|
click_button "Save"
|
||||||
|
expect(Setting.reserved_usernames).to eq(['Kosmos', 'Kredits'])
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user