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