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:
parent
3dbdec1c2c
commit
fd42607c17
1 changed files with 1 additions and 5 deletions
|
@ -722,11 +722,7 @@ RSpec.describe Account do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'validations' do
|
describe 'validations' do
|
||||||
it 'is invalid without a username' do
|
it { is_expected.to validate_presence_of(:username) }
|
||||||
account = Fabricate.build(:account, username: nil)
|
|
||||||
account.valid?
|
|
||||||
expect(account).to model_have_error_on_field(:username)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'squishes the username before validation' do
|
it 'squishes the username before validation' do
|
||||||
account = Fabricate(:account, domain: nil, username: " \u3000bob \t \u00a0 \n ")
|
account = Fabricate(:account, domain: nil, username: " \u3000bob \t \u00a0 \n ")
|
||||||
|
|
Loading…
Reference in a new issue