Simplify account model username presence validation spec (#31013)
This commit is contained in:
parent
fcb83be8b2
commit
67faaf5557
4 changed files with 14 additions and 5 deletions
|
@ -722,11 +722,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 ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue