admin_settings_spec.rb 573 B

1234567891011121314151617181920
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe Form::AdminSettings do
  4. describe 'Validations' do
  5. describe 'site_contact_username' do
  6. context 'with no accounts' do
  7. it { is_expected.to_not allow_value('Test').for(:site_contact_username) }
  8. end
  9. context 'with an account' do
  10. before { Fabricate(:account, username: 'Glorp') }
  11. it { is_expected.to_not allow_value('Test').for(:site_contact_username) }
  12. it { is_expected.to allow_value('Glorp').for(:site_contact_username) }
  13. end
  14. end
  15. end
  16. end