Compare commits
2 Commits
346e36e160
...
df3ec9f90a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df3ec9f90a
|
||
|
|
25a0723166
|
@@ -4,7 +4,9 @@ RSpec.describe 'Admin dashboard', type: :feature do
|
||||
let(:user) { create :user }
|
||||
|
||||
before do
|
||||
allow(user).to receive(:is_admin?).and_return(true)
|
||||
allow(Devise::LDAP::Adapter).to receive(:get_ldap_param)
|
||||
.with(user.cn, :admin).and_return(["true"])
|
||||
|
||||
login_as user, :scope => :user
|
||||
end
|
||||
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user