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