1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Use validate_presence_of for Account.username spec

This commit is contained in:
Matt Jankowski 2024-07-12 10:26:15 -04:00
parent 9f758fe4b0
commit db88595632

View file

@ -714,11 +714,7 @@ RSpec.describe Account do
end
describe 'validations' do
it 'is invalid without a username' do
account = Fabricate.build(:account, username: nil)
account.valid?
expect(account).to model_have_error_on_field(:username)
end
it { is_expected.to validate_presence_of(:username) }
it 'squishes the username before validation' do
account = Fabricate(:account, domain: nil, username: " \u3000bob \t \u00a0 \n ")