Replace peform_enqueued_jobs with sidekiq_perform_enqueued_jobs in specs (#6454)

* Replace peform_enqueued_jobs with sidekiq_perform_enqueued_jobs in specs

* Fix typo in reaction_spec
This commit is contained in:
Julianna Tetreault 2020-03-04 11:39:48 -07:00 committed by GitHub
parent ec98a4f271
commit f6478fb7cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 15 additions and 15 deletions

View file

@ -40,7 +40,7 @@ RSpec.describe Follow, type: :model do
it "doesn't create a channel when a followable is an org" do
expect do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
described_class.create!(follower: user, followable: create(:organization))
end
end.not_to change(ChatChannel, :count)
@ -48,7 +48,7 @@ RSpec.describe Follow, type: :model do
it "doesn't create a chat channel when users don't follow mutually" do
expect do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
described_class.create!(follower: user, followable: user_2)
end
end.not_to change(ChatChannel, :count)

View file

@ -143,7 +143,7 @@ RSpec.describe Reaction, type: :model do
end
it "updates updated_at if the reactable is a comment" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
updated_at = 1.day.ago
comment = create(:comment, commentable: article, updated_at: updated_at)
reaction.update(reactable: comment)
@ -152,7 +152,7 @@ RSpec.describe Reaction, type: :model do
end
it "updates updated_at for the user" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
updated_at = user.updated_at
Timecop.travel(1.day.from_now) do
reaction.save

View file

@ -439,7 +439,7 @@ RSpec.describe User, type: :model do
end
it "sets correct language_settings by default after the jobs are processed" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
expect(user.language_settings).to eq("preferred_languages" => %w[en])
end
end

View file

@ -88,7 +88,7 @@ RSpec.describe "ArticlesCreate", type: :request do
it "doesn't fail when executing jobs" do
stub_request(:post, url).to_return(status: 200)
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
post "/articles", params: article_params
end
end

View file

@ -7,7 +7,7 @@ RSpec.describe "HtmlVariantSuccesses", type: :request do
describe "POST /html_variant_successes" do
it "rejects non-permissioned user" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
post "/html_variant_successes", params: {
article_id: article.id,
html_variant_id: html_variant.id

View file

@ -7,7 +7,7 @@ RSpec.describe "HtmlVariantTrials", type: :request do
describe "POST /html_variant_trials" do
it "rejects non-permissioned user" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
post "/html_variant_trials", params: {
article_id: article.id,
html_variant_id: html_variant.id

View file

@ -27,7 +27,7 @@ RSpec.describe "/internal/tags", type: :request do
it "creates entry for #update action" do
allow(AssignTagModerator).to receive(:add_tag_moderators)
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
put "/internal/tags/#{tag.id}", params: update_params(tag_moderator.id.to_s)
log = AuditLog.where(user_id: super_admin.id, slug: :update)
expected = update_params(tag_moderator.id.to_s)[:tag]

View file

@ -28,7 +28,7 @@ RSpec.describe "Internal::Users", type: :request do
create(:reaction, reactable: comment2, reactable_type: "Comment", user: user2)
# create user3 reaction to offending article
create(:reaction, reactable: article, reactable_type: "Article", user: user3, category: "like")
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
Mention.create_all(comment2)
end
end
@ -167,7 +167,7 @@ RSpec.describe "Internal::Users", type: :request do
user_id: user2.id,
commentable: article2,
)
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
Mention.create_all(comment)
end
end

View file

@ -560,7 +560,7 @@ RSpec.describe "NotificationsIndex", type: :request do
user.add_role :trusted
user.update(mod_roundrobin_notifications: false)
sign_in user
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
Notification.send_moderation_notification(comment)
end
get "/notifications"

View file

@ -58,7 +58,7 @@ RSpec.describe "Oauth::Tokens", type: :request do
end
it "doesn't destroy webhooks" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
post oauth_revoke_path, params: { token: access_token.token }
end
expect(user_webhook.reload).to be_persisted

View file

@ -131,7 +131,7 @@ RSpec.describe "UserSettings", type: :request do
end
it "does not send an email if there was no request" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
expect { send_request(false) }.not_to(change { ActionMailer::Base.deliveries.count })
end
end

View file

@ -97,7 +97,7 @@ RSpec.describe Podcasts::GetEpisode, type: :service do
end
it "doesn't create invalid episodes" do
perform_enqueued_jobs do
sidekiq_perform_enqueued_jobs do
expect do
described_class.new(podcast).call(item: item)
end.not_to change(PodcastEpisode, :count)