|
@ -381,6 +381,12 @@ RSpec.describe Account, type: :model do |
|
|
expect(account_2).to model_have_error_on_field(:username) |
|
|
expect(account_2).to model_have_error_on_field(:username) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it 'is invalid if the username is reserved' do |
|
|
|
|
|
account = Fabricate.build(:account, username: 'support') |
|
|
|
|
|
account.valid? |
|
|
|
|
|
expect(account).to model_have_error_on_field(:username) |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
context 'when is local' do |
|
|
context 'when is local' do |
|
|
it 'is invalid if the username doesn\'t only contains letters, numbers and underscores' do |
|
|
it 'is invalid if the username doesn\'t only contains letters, numbers and underscores' do |
|
|
account = Fabricate.build(:account, username: 'the-doctor') |
|
|
account = Fabricate.build(:account, username: 'the-doctor') |
|
|