0
0
Fork 0

Add not_featured_by scope to Tag (#28815)

This commit is contained in:
Matt Jankowski 2024-04-17 06:05:38 -04:00 committed by GitHub
parent 1d3ecd3fba
commit 650c548c31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 6 deletions

View file

@ -142,6 +142,25 @@ RSpec.describe Tag do
end
end
describe '.not_featured_by' do
let!(:account) { Fabricate(:account) }
let!(:fun) { Fabricate(:tag, name: 'fun') }
let!(:games) { Fabricate(:tag, name: 'games') }
before do
Fabricate :featured_tag, account: account, name: 'games'
Fabricate :featured_tag, name: 'fun'
end
it 'returns tags not featured by the account' do
results = described_class.not_featured_by(account)
expect(results)
.to include(fun)
.and not_include(games)
end
end
describe '.matches_name' do
it 'returns tags for multibyte case-insensitive names' do
upcase_string = 'abcABCやゆよ'