mastodon/spec/models/form/admin_settings_spec.rb

21 lines
573 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Form::AdminSettings do
describe 'Validations' do
describe 'site_contact_username' do
context 'with no accounts' do
it { is_expected.to_not allow_value('Test').for(:site_contact_username) }
end
context 'with an account' do
before { Fabricate(:account, username: 'Glorp') }
it { is_expected.to_not allow_value('Test').for(:site_contact_username) }
it { is_expected.to allow_value('Glorp').for(:site_contact_username) }
end
end
end
end