diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-03-13 15:16:02 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-03-13 15:16:02 +0100 |
commit | 02062aab55cb6f8da527998a210775c2ad695eed (patch) | |
tree | ab606ee84d964f28dad5bc77cfbd49b5c12849fa /spec/models | |
parent | c2857c976c7d4a8bbd02c3c18569913f2bf8a034 (diff) | |
parent | 06663fcf87fe0d6bc71336e6f212b82f098066d7 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/controllers/about_controller.rb - app/controllers/tags_controller.rb - app/views/about/show.html.haml - spec/views/about/show.html.haml_spec.rb
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/account_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index a43421b76..379872316 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -558,6 +558,11 @@ RSpec.describe Account, type: :model do expect(account).to model_have_error_on_field(:username) end + it 'squishes the username before validation' do + account = Fabricate(:account, domain: nil, username: " \u3000bob \t \u00a0 \n ") + expect(account.username).to eq 'bob' + end + context 'when is local' do it 'is invalid if the username is not unique in case-insensitive comparison among local accounts' do account_1 = Fabricate(:account, username: 'the_doctor') |