2023-03-10 07:33:30 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 01:12:25 -04:00
|
|
|
RSpec.describe Form::AdminSettings do
|
2024-10-24 08:44:13 -04:00
|
|
|
describe 'Validations' do
|
2023-03-10 07:33:30 -05:00
|
|
|
describe 'site_contact_username' do
|
|
|
|
context 'with no accounts' do
|
2024-10-24 08:44:13 -04:00
|
|
|
it { is_expected.to_not allow_value('Test').for(:site_contact_username) }
|
2023-03-10 07:33:30 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'with an account' do
|
|
|
|
before { Fabricate(:account, username: 'Glorp') }
|
|
|
|
|
2024-10-24 08:44:13 -04:00
|
|
|
it { is_expected.to_not allow_value('Test').for(:site_contact_username) }
|
|
|
|
it { is_expected.to allow_value('Glorp').for(:site_contact_username) }
|
2023-03-10 07:33:30 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|