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