about summary refs log tree commit diff
path: root/spec/models/account_spec.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-11-27 16:26:18 +0100
committerGitHub <noreply@github.com>2018-11-27 16:26:18 +0100
commit33be091f506242b136b0d4a65cf06a0babc4d757 (patch)
tree0f9f6e40e40f4ecabfa1e5f906000abe756f42a9 /spec/models/account_spec.rb
parent6b6e633c095485f95350c4308a942192e5fe8806 (diff)
parent55edfd6e0e1cb5377f0c3406d94ddfd84ddb7b20 (diff)
Merge pull request #828 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
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