about summary refs log tree commit diff
path: root/spec/models/account_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/account_spec.rb')
-rw-r--r--spec/models/account_spec.rb26
1 files changed, 7 insertions, 19 deletions
diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb
index 5baf70ef9..a43421b76 100644
--- a/spec/models/account_spec.rb
+++ b/spec/models/account_spec.rb
@@ -618,9 +618,15 @@ RSpec.describe Account, type: :model do
         expect(account).not_to model_have_error_on_field(:username)
       end
 
-      it 'is invalid if the username doesn\'t only contains letters, numbers and underscores' do
+      it 'is valid even if the username contains hyphens' do
         account = Fabricate.build(:account, domain: 'domain', username: 'the-doctor')
         account.valid?
+        expect(account).to_not model_have_error_on_field(:username)
+      end
+
+      it 'is invalid if the username doesn\'t only contains letters, numbers, underscores and hyphens' do
+        account = Fabricate.build(:account, domain: 'domain', username: 'the doctor')
+        account.valid?
         expect(account).to model_have_error_on_field(:username)
       end
 
@@ -754,24 +760,6 @@ RSpec.describe Account, type: :model do
         expect(Account.suspended).to match_array([account_1])
       end
     end
-
-    describe 'without_followers' do
-      it 'returns a relation of accounts without followers' do
-        account_1 = Fabricate(:account)
-        account_2 = Fabricate(:account)
-        Fabricate(:follow, account: account_1, target_account: account_2)
-        expect(Account.without_followers).to match_array([account_1])
-      end
-    end
-
-    describe 'with_followers' do
-      it 'returns a relation of accounts with followers' do
-        account_1 = Fabricate(:account)
-        account_2 = Fabricate(:account)
-        Fabricate(:follow, account: account_1, target_account: account_2)
-        expect(Account.with_followers).to match_array([account_2])
-      end
-    end
   end
 
   context 'when is local' do