Merge remote-tracking branch 'parent/main' into upstream-20240422
This commit is contained in:
commit
44f4a93430
100 changed files with 770 additions and 441 deletions
|
@ -44,5 +44,18 @@ describe Account::Counters do
|
|||
|
||||
expect(account.statuses_count).to eq 5
|
||||
end
|
||||
|
||||
it 'preserves last_status_at when decrementing statuses_count' do
|
||||
account_stat = Fabricate(
|
||||
:account_stat,
|
||||
account: account,
|
||||
last_status_at: 3.days.ago,
|
||||
statuses_count: 10
|
||||
)
|
||||
|
||||
expect { account.decrement_count!(:statuses_count) }
|
||||
.to change(account_stat.reload, :statuses_count).by(-1)
|
||||
.and not_change(account_stat.reload, :last_status_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -281,7 +281,7 @@ RSpec.describe Form::Import do
|
|||
end
|
||||
|
||||
it 'defaults to unconfirmed true' do
|
||||
expect(bulk_import.unconfirmed?).to be true
|
||||
expect(bulk_import.state_unconfirmed?).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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 = 'abcABCabcABCやゆよ'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue