Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/models/status.rb

Resolved by taking both changes (not a real conflict, just changes too close
to each other).
This commit is contained in:
Thibaut Girka
2018-11-27 13:23:02 +01:00
183 changed files with 2365 additions and 697 deletions

View File

@ -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