Use Sidekiq fake!
instead of inline!
in specs (#25369)
This commit is contained in:
parent
ea1c0feb86
commit
00341c70ff
53 changed files with 66 additions and 76 deletions
|
@ -147,7 +147,7 @@ RSpec.describe 'FeaturedTags' do
|
|||
expect(body).to be_empty
|
||||
end
|
||||
|
||||
it 'deletes the featured tag' do
|
||||
it 'deletes the featured tag', :sidekiq_inline do
|
||||
delete "/api/v1/featured_tags/#{id}", headers: headers
|
||||
|
||||
featured_tag = FeaturedTag.find_by(id: id)
|
||||
|
|
|
@ -8,7 +8,7 @@ RSpec.describe 'Notifications' do
|
|||
let(:scopes) { 'read:notifications write:notifications' }
|
||||
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
|
||||
|
||||
describe 'GET /api/v1/notifications' do
|
||||
describe 'GET /api/v1/notifications', :sidekiq_inline do
|
||||
subject do
|
||||
get '/api/v1/notifications', headers: headers, params: params
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Favourites' do
|
||||
RSpec.describe 'Favourites', :sidekiq_inline do
|
||||
let(:user) { Fabricate(:user) }
|
||||
let(:scopes) { 'write:favourites' }
|
||||
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
|
||||
|
@ -70,7 +70,7 @@ RSpec.describe 'Favourites' do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'POST /api/v1/statuses/:status_id/unfavourite', :sidekiq_fake do
|
||||
describe 'POST /api/v1/statuses/:status_id/unfavourite' do
|
||||
subject do
|
||||
post "/api/v1/statuses/#{status.id}/unfavourite", headers: headers
|
||||
end
|
||||
|
@ -88,9 +88,7 @@ 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
|
||||
|
||||
|
@ -113,9 +111,7 @@ 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
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
describe 'Home' do
|
||||
describe 'Home', :sidekiq_inline do
|
||||
let(:user) { Fabricate(:user) }
|
||||
let(:scopes) { 'read:statuses' }
|
||||
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue