Wrong count in response when removing favourite/reblog (#24365)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
6edd404482
commit
4c18928a93
7 changed files with 73 additions and 19 deletions
|
@ -77,6 +77,12 @@ RSpec.describe 'Favourites' do
|
|||
|
||||
let(:status) { Fabricate(:status) }
|
||||
|
||||
around do |example|
|
||||
Sidekiq::Testing.fake! do
|
||||
example.run
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'forbidden for wrong scope', 'read read:favourites'
|
||||
|
||||
context 'with public status' do
|
||||
|
@ -88,6 +94,9 @@ RSpec.describe 'Favourites' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(user.account.favourited?(status)).to be true
|
||||
|
||||
UnfavouriteWorker.drain
|
||||
expect(user.account.favourited?(status)).to be false
|
||||
end
|
||||
|
||||
|
@ -110,6 +119,9 @@ RSpec.describe 'Favourites' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(user.account.favourited?(status)).to be true
|
||||
|
||||
UnfavouriteWorker.drain
|
||||
expect(user.account.favourited?(status)).to be false
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue