source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/generate_sales_report_job_spec.rb
Ruby
mit
8,966
main
11,044
# frozen_string_literal: true require "spec_helper" describe GenerateSalesReportJob do let (:country_code) { "GB" } let(:start_date) { Date.new(2015, 1, 1) } let (:end_date) { Date.new(2015, 3, 31) } it "raises an argument error if the country code is not valid" do expect { described_class.new.perform("A...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/trigger_community_chat_recap_run_job_spec.rb
Ruby
mit
8,966
main
6,817
# frozen_string_literal: true require "spec_helper" RSpec.describe TriggerCommunityChatRecapRunJob do subject(:job) { described_class.new } describe "#perform" do context "when recap_frequency is invalid" do it "raises ArgumentError" do expect { job.perform("invalid") }.to raise_error(ArgumentE...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/free_trial_expiring_reminder_worker_spec.rb
Ruby
mit
8,966
main
2,291
# frozen_string_literal: true require "spec_helper" describe FreeTrialExpiringReminderWorker, :vcr do let(:purchase) { create(:free_trial_membership_purchase) } let(:subscription) { purchase.subscription } it "sends an email if the subscription is currently in a free trial" do expect do described_cla...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/create_us_states_sales_summary_report_job_spec.rb
Ruby
mit
8,966
main
5,921
# frozen_string_literal: true require "spec_helper" describe CreateUsStatesSalesSummaryReportJob do let(:subdivision_codes) { ["WA", "WI"] } let(:month) { 8 } let(:year) { 2022 } it "raises an argument error if the year is out of bounds" do expect { described_class.new.perform(subdivision_codes, month, 2...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_user_balance_stats_cache_worker_spec.rb
Ruby
mit
8,966
main
398
# frozen_string_literal: true require "spec_helper" describe UpdateUserBalanceStatsCacheWorker do describe "#perform" do it "writes cache" do user = create(:user) expect(UserBalanceStatsService.new(user:).send(:read_cache)).to eq(nil) described_class.new.perform(user.id) expect(UserBalan...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/generate_subscribe_preview_job_spec.rb
Ruby
mit
8,966
main
1,459
# frozen_string_literal: true require "spec_helper" describe GenerateSubscribePreviewJob do let(:user) { create(:user, username: "foo") } describe "#perform" do context "image generation works" do before :each do subscribe_preview = File.binread("#{Rails.root}/spec/support/fixtures/subscribe_pr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_stripe_apple_pay_domain_worker_spec.rb
Ruby
mit
8,966
main
863
# frozen_string_literal: true describe DeleteStripeApplePayDomainWorker, :vcr do describe "#perform" do before do @user = create(:user) @domain = "sampleusername.gumroad.dev" end it "deletes StripeApplePayDomain record when record exists on Stripe" do response = Stripe::ApplePayDomain....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/refresh_sitemap_monthly_worker_spec.rb
Ruby
mit
8,966
main
897
# frozen_string_literal: true require "spec_helper" describe RefreshSitemapMonthlyWorker do describe "#perform" do it "enqueues jobs to generate sitemaps for products updated in last month" do product_1 = create(:product, created_at: 3.months.ago, updated_at: 1.month.ago) product_2 = create(:product...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_helper_event_worker_spec.rb
Ruby
mit
8,966
main
2,731
# frozen_string_literal: true require "spec_helper" describe HandleHelperEventWorker do include Rails.application.routes.url_helpers let!(:params) do { "event": "conversation.created", "payload": { "conversation_id": "6d389b441fcb17378effbdc4192ee69d", "email_id": "123", "...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/invalidate_product_cache_worker_spec.rb
Ruby
mit
8,966
main
327
# frozen_string_literal: true describe InvalidateProductCacheWorker do describe "#perform" do before do @product = create(:product) end it "expires the product cache" do expect_any_instance_of(Link).to receive(:invalidate_cache).once described_class.new.perform(@product.id) end e...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_paypal_event_worker_spec.rb
Ruby
mit
8,966
main
449
# frozen_string_literal: true require "spec_helper" describe HandlePaypalEventWorker do describe "perform" do it "calls handle_paypal_event on HandlePaypalEventWorker" do id = rand(10_000) params = { id: } expect(PaypalEventHandler).to receive(:new).with(params).and_call_original expect_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/fail_abandoned_purchase_worker_spec.rb
Ruby
mit
8,966
main
11,537
# frozen_string_literal: true require "spec_helper" describe FailAbandonedPurchaseWorker, :vcr do include ManageSubscriptionHelpers describe "#perform" do let(:chargeable) { build(:chargeable, card: StripePaymentMethodHelper.success_with_sca) } context "when purchase has succeeded" do let!(:purcha...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/push_notification_worker_spec.rb
Ruby
mit
8,966
main
3,772
# frozen_string_literal: true require "spec_helper" describe PushNotificationWorker do before do @user = create(:user) @device_a = create(:device, user: @user) @device_b = create(:android_device, user: @user) @device_c = create(:device, user: @user) end it "sends the notification to each of the...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/charge_declined_reminder_worker_spec.rb
Ruby
mit
8,966
main
2,538
# frozen_string_literal: true require "spec_helper" describe ChargeDeclinedReminderWorker, :vcr do before do @product = create(:membership_product, user: create(:user), subscription_duration: :monthly) @subscription = create(:subscription, user: create(:user, credit_card: create(:credit_card)), link: @produ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/post_to_individual_ping_endpoint_worker_spec.rb
Ruby
mit
8,966
main
10,870
# frozen_string_literal: true require "spec_helper" describe PostToIndividualPingEndpointWorker do before do @http_double = double allow(@http_double).to receive(:success?).and_return(true) allow(@http_double).to receive(:code).and_return(200) end describe "post to individual endpoint" do conte...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/create_missing_purchase_events_worker_spec.rb
Ruby
mit
8,966
main
1,597
# frozen_string_literal: true require "spec_helper" describe CreateMissingPurchaseEventsWorker do let!(:purchase) do create(:purchase, created_at: 1.day.ago, ip_country: "United States", ip_state: "CA") do |purchase| purchase.seller.update!(timezone: "UTC") end end it "creates the missing event a...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_stripe_currency_balances_report_job_spec.rb
Ruby
mit
8,966
main
821
# frozen_string_literal: true describe SendStripeCurrencyBalancesReportJob do describe "perform" do before do @mailer_double = double("mailer") allow(AccountingMailer).to receive(:stripe_currency_balances_report).and_return(@mailer_double) allow(StripeCurrencyBalancesReport).to receive(:stripe_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_expired_product_cached_values_worker_spec.rb
Ruby
mit
8,966
main
1,381
# frozen_string_literal: true require "spec_helper" describe DeleteExpiredProductCachedValuesWorker do describe "#perform" do it "deletes expired rows, except the latest one per product" do product_1 = create(:product) create_list(:product_cached_value, 3, :expired, product: product_1) # should dele...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_payment_reminder_worker_spec.rb
Ruby
mit
8,966
main
1,895
# frozen_string_literal: true describe SendPaymentReminderWorker do describe "perform" do before do @user = create(:user, payment_address: nil) create(:balance, user: @user, amount_cents: 1001) end it "notifies users to update payment information" do expect do described_class.n...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_seller_refund_eligibility_job_spec.rb
Ruby
mit
8,966
main
2,531
# frozen_string_literal: true require "spec_helper" describe UpdateSellerRefundEligibilityJob do let(:user) { create(:user) } before do # Factory `:balance` expects Gumroad's platform merchant account to exist. MerchantAccount.find_or_create_by!(user_id: nil, charge_processor_id: StripeChargeProcessor.ch...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/build_tax_rate_cache_worker_spec.rb
Ruby
mit
8,966
main
1,093
# frozen_string_literal: true require "spec_helper" describe BuildTaxRateCacheWorker do describe ".perform" do it "caches the maximum tax rate per state to be used in the product edit flow" do create(:zip_tax_rate, combined_rate: 0.09, state: "CA") create(:zip_tax_rate, combined_rate: 0.095, state: ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/generate_financial_reports_for_previous_month_job_spec.rb
Ruby
mit
8,966
main
1,483
# frozen_string_literal: true require "spec_helper" describe GenerateFinancialReportsForPreviousMonthJob do describe ".perform" do it "does not generate any reports when the Rails environment is not production" do described_class.new.perform expect(CreateCanadaMonthlySalesReportJob.jobs.size).to eq...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/large_sellers_update_user_balance_stats_cache_worker_spec.rb
Ruby
mit
8,966
main
551
# frozen_string_literal: true require "spec_helper" describe LargeSellersUpdateUserBalanceStatsCacheWorker do describe "#perform" do it "queues a job for each cacheable user" do ids = create_list(:user, 2).map(&:id) expect(UserBalanceStatsService).to receive(:cacheable_users).and_return(User.where(i...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/purge_old_deleted_asset_previews_worker_spec.rb
Ruby
mit
8,966
main
564
# frozen_string_literal: true require "spec_helper" describe PurgeOldDeletedAssetPreviewsWorker do describe "#perform" do it "deletes targeted rows" do stub_const("#{described_class}::DELETION_BATCH_SIZE", 1) create(:asset_preview, deleted_at: 2.months.ago) recently_marked_as_deleted = create(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/fight_dispute_job_spec.rb
Ruby
mit
8,966
main
4,061
# frozen_string_literal: true require "spec_helper" describe FightDisputeJob do describe "#perform" do let(:dispute_evidence) { create(:dispute_evidence) } let(:dispute) { dispute_evidence.dispute } shared_examples_for "submitted dispute evidence" do it "fights chargeback" do expect_any_i...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_charge_receipt_job_spec.rb
Ruby
mit
8,966
main
2,589
# frozen_string_literal: true require "spec_helper" describe SendChargeReceiptJob do let(:seller) { create(:named_seller) } let(:product_one) { create(:product, user: seller, name: "Product One") } let(:purchase_one) { create(:purchase, link: product_one, seller: seller) } let(:product_two) { create(:product,...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/create_stripe_apple_pay_domain_worker_spec.rb
Ruby
mit
8,966
main
690
# frozen_string_literal: true describe CreateStripeApplePayDomainWorker, :vcr do describe "#perform" do before do @user = create(:user, username: "sampleusername") allow(Subdomain).to receive(:from_username).and_return("sampleusername.gumroad.dev") allow(Rails.env).to receive(:test?).and_return...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/google_calendar_invite_job_spec.rb
Ruby
mit
8,966
main
4,416
# frozen_string_literal: true require "spec_helper" describe GoogleCalendarInviteJob do describe "#perform" do let(:call) { create(:call) } let(:link) { call.link } let(:buyer_email) { "buyer@example.com" } let(:google_calendar_integration) { create(:google_calendar_integration) } let(:gcal_api)...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_new_bank_account_worker_spec.rb
Ruby
mit
8,966
main
1,173
# frozen_string_literal: true describe HandleNewBankAccountWorker do describe "perform" do let(:bank_account) { create(:ach_account) } it "calls StripeMerchantAccountManager.handle_new_bank_account with the bank account object" do expect(StripeMerchantAccountManager).to receive(:handle_new_bank_accoun...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/unblock_object_worker_spec.rb
Ruby
mit
8,966
main
441
# frozen_string_literal: true describe UnblockObjectWorker do describe "#perform" do let(:email_domain) { "example.com" } it "unblocks email domains" do BlockedObject.block!(BLOCKED_OBJECT_TYPES[:email_domain], email_domain, nil) expect(BlockedObject.active.email_domain.count).to eq(1) de...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/moderate_products_job_spec.rb
Ruby
mit
8,966
main
2,014
# frozen_string_literal: true require "spec_helper" describe ModerateProductsJob do let(:product1) { create(:product) } let(:product2) { create(:product) } let(:passed_result) { ContentModeration::ModerateRecordService::CheckResult.new(passed: true, reasons: []) } before do allow(ContentModeration::Moder...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/stripe_transfer_gumroads_available_balances_to_gumroads_bank_account_worker_spec.rb
Ruby
mit
8,966
main
1,894
# frozen_string_literal: true require "spec_helper" describe StripeTransferGumroadsAvailableBalancesToGumroadsBankAccountWorker, :vcr do include StripeChargesHelper describe "#perform" do let(:estimate_held_amount_cents) { { HolderOfFunds::GUMROAD => 30_000_00, HolderOfFunds::STRIPE => 20_000_00 } } bef...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_old_sent_email_info_records_job_spec.rb
Ruby
mit
8,966
main
580
# frozen_string_literal: true require "spec_helper" describe DeleteOldSentEmailInfoRecordsJob do describe "#perform" do it "deletes targeted rows" do create(:sent_email_info, created_at: 3.years.ago) create(:sent_email_info, created_at: 2.years.ago) create(:sent_email_info, created_at: 6.month...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_to_elasticsearch_worker_spec.rb
Ruby
mit
8,966
main
1,745
# frozen_string_literal: true require "spec_helper" describe SendToElasticsearchWorker do before do @product = create(:product) @product_double = double("product") end it "attempts to index the product in Elasticsearch when instructed" do expect(Link).to receive(:find_by).with(id: @product.id) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/refund_purchase_worker_spec.rb
Ruby
mit
8,966
main
945
# frozen_string_literal: true require "spec_helper" describe RefundPurchaseWorker do describe "#perform" do let(:admin_user) { create(:admin_user) } let(:purchase) { create(:purchase) } let(:purchase_double) { double } before do expect(Purchase).to receive(:find).with(purchase.id).and_return(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/review_reminder_job_spec.rb
Ruby
mit
8,966
main
2,207
# frozen_string_literal: true require "spec_helper" describe ReviewReminderJob do let(:purchase) { create(:purchase) } it "sends an email" do expect do described_class.new.perform(purchase.id) end.to have_enqueued_mail(CustomerLowPriorityMailer, :purchase_review_reminder).with(purchase.id) end ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_purchase_receipt_job_spec.rb
Ruby
mit
8,966
main
2,312
# frozen_string_literal: true require "spec_helper" describe SendPurchaseReceiptJob do let(:seller) { create(:named_seller) } let(:product) { create(:product, user: seller) } let(:purchase) { create(:purchase, link: product, seller: seller) } let(:mail_double) { double } before do allow(mail_double).to...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/find_expired_subscriptions_to_set_as_deactivated_worker_spec.rb
Ruby
mit
8,966
main
1,423
# frozen_string_literal: true require "spec_helper" describe FindExpiredSubscriptionsToSetAsDeactivatedWorker do describe "#perform" do it "queues subscriptions that should be set as deactivated" do subscriptions = [ create(:subscription), create(:subscription, cancelled_at: 1.day.from_now...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/elasticsearch_indexer_worker_spec.rb
Ruby
mit
8,966
main
12,241
# frozen_string_literal: true require "spec_helper" describe ElasticsearchIndexerWorker, :elasticsearch_wait_for_refresh do describe "#perform without ActiveRecord objects" do before do class TravelEvent include Elasticsearch::Model index_name "test_travel_events" end EsClient....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_utm_link_stats_job_spec.rb
Ruby
mit
8,966
main
607
# frozen_string_literal: true describe UpdateUtmLinkStatsJob do describe "#perform" do let(:utm_link) { create(:utm_link) } let!(:utm_link_visit1) { create(:utm_link_visit, utm_link:, browser_guid: "abc123") } let!(:utm_link_visit2) { create(:utm_link_visit, utm_link:, browser_guid: "def456") } let!(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/generate_username_job_spec.rb
Ruby
mit
8,966
main
726
# frozen_string_literal: true require "spec_helper" describe GenerateUsernameJob do describe "#perform" do context "username is present" do it "does not generate a new username" do user = create(:user, username: "foo") expect_any_instance_of(UsernameGeneratorService).not_to receive(:userna...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_preorder_seller_summary_worker_spec.rb
Ruby
mit
8,966
main
3,740
# frozen_string_literal: true require "spec_helper" describe SendPreorderSellerSummaryWorker, :vcr do before do travel_to 2.days.ago @product = create(:product, price_cents: 600, is_in_preorder_state: false) @preorder_product = create(:preorder_product_with_content, link: @product, release_at: 2.days.fr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/perform_payouts_up_to_delay_days_ago_worker_spec.rb
Ruby
mit
8,966
main
560
# frozen_string_literal: true describe PerformPayoutsUpToDelayDaysAgoWorker do describe "perform" do let(:payout_period_end_date) { User::PayoutSchedule.next_scheduled_payout_end_date } let(:payout_processor_type) { PayoutProcessorType::PAYPAL } it "calls 'create_payments_for_balances_up_to_date' on 'Pa...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_grmc_callback_job_spec.rb
Ruby
mit
8,966
main
2,482
# frozen_string_literal: true describe HandleGrmcCallbackJob do let(:product_file) { create(:product_file) } let(:transcoded_video) { create(:transcoded_video, job_id: "test_job_id", streamable: product_file, transcoded_video_key: "/attachments/68756f28973n28347/hls/", state: :processing) } describe "#perform" ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/publish_scheduled_post_job_spec.rb
Ruby
mit
8,966
main
2,373
# frozen_string_literal: true describe PublishScheduledPostJob, :freeze_time do before do @post = create(:audience_installment, shown_on_profile: true, send_emails: true) @rule = create(:installment_rule, installment: @post) end describe "#perform" do it "publishes post, creates a blast and enqueues...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_last_post_job_spec.rb
Ruby
mit
8,966
main
3,129
# frozen_string_literal: true require "spec_helper" describe SendLastPostJob do describe "#perform" do let(:product) { create(:membership_product) } let(:tier) { product.default_tier } let(:purchase) { create(:membership_purchase, link: product, seller: product.user, tier:) } let(:recipient) { { ema...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/activate_integrations_worker_spec.rb
Ruby
mit
8,966
main
624
# frozen_string_literal: true require "spec_helper" describe ActivateIntegrationsWorker do it "calls CircleIntegrationService#activate" do purchase = create(:purchase) expect_any_instance_of(Integrations::CircleIntegrationService).to receive(:activate).with(purchase) described_class.new.perform(purchas...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/block_object_worker_spec.rb
Ruby
mit
8,966
main
1,424
# frozen_string_literal: true describe BlockObjectWorker do describe "#perform" do let(:admin_user) { create(:admin_user) } context "when blocking email domain" do let(:identifier) { "example.com" } it "blocks email domains without expiration" do expect(BlockedObject.email_domain.count)...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/check_payment_address_worker_spec.rb
Ruby
mit
8,966
main
6,170
# frozen_string_literal: true describe CheckPaymentAddressWorker do describe "payment address checks" do before do @previously_banned_user = create(:user, user_risk_state: "suspended_for_fraud", payment_address: "tuhins@gmail.com") @blocked_email_object = BlockedObject.block!(BLOCKED_OBJECT_TYPES[:em...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/sync_stuck_purchases_job_spec.rb
Ruby
mit
8,966
main
10,272
# frozen_string_literal: true require "spec_helper" describe SyncStuckPurchasesJob, :vcr do describe "#perform" do let(:product) { create(:product) } before do stub_const("GUMROAD_ADMIN_ID", create(:admin_user).id) end it "does not sync any purchases if there are none in progress" do cr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/remove_deleted_files_from_s3_job_spec.rb
Ruby
mit
8,966
main
3,075
# frozen_string_literal: true require "spec_helper" describe RemoveDeletedFilesFromS3Job do before do allow_any_instance_of(described_class).to receive(:delete_s3_objects!) end it "removes recently deleted files from S3" do product_file = create(:product_file, deleted_at: 26.hours.ago) product_file...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/expire_stamped_pdfs_job_spec.rb
Ruby
mit
8,966
main
437
# frozen_string_literal: true require "spec_helper" describe ExpireStampedPdfsJob do describe "#perform" do it "marks old stamped pdfs as deleted" do record_1 = create(:stamped_pdf, created_at: 1.year.ago) record_2 = create(:stamped_pdf, created_at: 1.day.ago) described_class.new.perform ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/collect_unclaimed_balances_of_inactive_stripe_accounts_job_spec.rb
Ruby
mit
8,966
main
15,649
# frozen_string_literal: true describe CollectUnclaimedBalancesOfInactiveStripeAccountsJob do describe "#perform", :vcr do before do stub_const("CollectUnclaimedBalancesOfInactiveStripeAccountsJob::STRIPE_ACCOUNT_INACTIVE_AFTER_DURATION", 3.weeks) end it "collects the balance amount from inactive ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_workflow_post_emails_job_spec.rb
Ruby
mit
8,966
main
8,425
# frozen_string_literal: true require "spec_helper" describe SendWorkflowPostEmailsJob, :freeze_time do before do @seller = create(:named_user) @workflow = create(:audience_workflow, seller: @seller) @post = create(:audience_post, :published, workflow: @workflow, seller: @seller) @post_rule = create...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/set_subscription_as_deactivated_worker_spec.rb
Ruby
mit
8,966
main
997
# frozen_string_literal: true require "spec_helper" describe SetSubscriptionAsDeactivatedWorker do describe "#perform" do it "sets subscription as deactivated" do product = create(:membership_product) purchase = create(:membership_purchase, link: product) subscription = purchase.subscription ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/regenerate_sales_related_products_infos_job_spec.rb
Ruby
mit
8,966
main
2,183
# frozen_string_literal: true require "spec_helper" describe RegenerateSalesRelatedProductsInfosJob do describe "#perform" do let(:seller) { create(:named_seller) } let(:sample_product) { create(:product, user: seller) } let(:product1) { create(:product, name: "Product 1") } let(:product2) { create(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/rename_product_file_worker_spec.rb
Ruby
mit
8,966
main
754
# frozen_string_literal: true require "spec_helper" describe RenameProductFileWorker do before do @product_file = create(:product_file, url: "#{AWS_S3_ENDPOINT}/#{S3_BUCKET}/attachment/pencil.png") end describe "#perform" do context "when file is present in CDN" do it "renames the file" do ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/end_subscription_worker_spec.rb
Ruby
mit
8,966
main
2,630
# frozen_string_literal: true require "spec_helper" describe EndSubscriptionWorker, :vcr do before do @product = create(:subscription_product, user: create(:user), duration_in_months: 1) @subscription = create(:subscription, user: create(:user, credit_card: create(:credit_card)), link: @product, charge_occu...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_product_rich_content_worker_spec.rb
Ruby
mit
8,966
main
6,207
# frozen_string_literal: true require "spec_helper" describe DeleteProductRichContentWorker do describe "#perform", :sidekiq_inline, :elasticsearch_wait_for_refresh do context "without versions" do before do @product_rich_content = create(:product_rich_content, entity: product, description: [{ "ty...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/reset_admin_action_call_counts_job_spec.rb
Ruby
mit
8,966
main
619
# frozen_string_literal: true require "spec_helper" describe ResetAdminActionCallCountsJob do describe "#perform" do it "recreates admin action call infos" do create(:admin_action_call_info, call_count: 25) create(:admin_action_call_info, controller_name: "NoLongerExistingController", call_count: 3)...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/transcode_video_for_streaming_worker_spec.rb
Ruby
mit
8,966
main
15,311
# frozen_string_literal: true describe TranscodeVideoForStreamingWorker do describe "#perform" do let(:product) { create(:product_with_video_file) } context "when the product file is not transcodable" do let(:product_file) { product.product_files.first } it "notifies the creator and does not cr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/log_sendgrid_event_worker_spec.rb
Ruby
mit
8,966
main
1,175
# frozen_string_literal: true describe LogSendgridEventWorker do describe "#perform" do let(:email) { "example@example.com" } let(:email_digest) { Digest::SHA1.hexdigest(email).first(12) } let(:event_timestamp) { 5.minutes.from_now } before do Feature.activate(:log_email_events) EmailEve...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_wishlist_products_job_spec.rb
Ruby
mit
8,966
main
699
# frozen_string_literal: true describe DeleteWishlistProductsJob do describe "#perform" do let(:product) { create(:product) } let!(:wishlist_product) { create(:wishlist_product, product:) } let!(:unrelated_wishlist_product) { create(:wishlist_product) } it "deletes associated wishlist products" do ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/analyze_file_worker_spec.rb
Ruby
mit
8,966
main
671
# frozen_string_literal: true describe AnalyzeFileWorker do describe "#perform" do before do allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("staging")) end it "calls analyze for product file when no class name is provided" do product_file = create(:product_file) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/block_stripe_suspected_fraudulent_payments_worker_spec.rb
Ruby
mit
8,966
main
3,135
# frozen_string_literal: true require "spec_helper" describe BlockStripeSuspectedFraudulentPaymentsWorker do describe "#perform" do before do @payload = JSON.parse(file_fixture("helper_conversation_created.json").read)["payload"] admin = create(:admin_user) stub_const("GUMROAD_ADMIN_ID", admin...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/pdf_unstampable_notifier_job_spec.rb
Ruby
mit
8,966
main
2,628
# frozen_string_literal: true require "spec_helper" describe PdfUnstampableNotifierJob do describe "#perform" do let!(:product) { create(:product_with_pdf_file) } it "does not notify seller if a pdf is stampable" do product.product_files.alive.pdf.each { |product_file| product_file.update!(pdf_stamp_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_product_files_archives_worker_spec.rb
Ruby
mit
8,966
main
4,548
# frozen_string_literal: true require "spec_helper" describe DeleteProductFilesArchivesWorker do before do @product = create(:product, user: create(:named_seller)) product_file_1 = create(:product_file, link: @product) product_file_2 = create(:product_file, link: @product) product_file_3 = create(:p...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/cache_product_data_worker_spec.rb
Ruby
mit
8,966
main
1,168
# frozen_string_literal: true describe CacheProductDataWorker do describe "#perform" do before do @product = create(:product) end it "creates new product cache data" do expect do described_class.new.perform(@product.id) end.to change { ProductCachedValue.count }.by(1) pr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_post_blast_emails_job_spec.rb
Ruby
mit
8,966
main
14,467
# frozen_string_literal: true require "spec_helper" describe SendPostBlastEmailsJob, :freeze_time do include Rails.application.routes.url_helpers, ActionView::Helpers::SanitizeHelper _routes.default_url_options = Rails.application.config.action_mailer.default_url_options before do @seller = create(:named_u...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/reindex_user_elasticsearch_data_worker_spec.rb
Ruby
mit
8,966
main
526
# frozen_string_literal: true describe ReindexUserElasticsearchDataWorker do it "reindexes ES data for user" do user = create(:user) admin = create(:admin_user) allow(DevTools).to receive(:reindex_all_for_user).and_return(nil) expect(DevTools).to receive(:reindex_all_for_user).with(user.id) desc...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/create_canada_monthly_sales_report_job_spec.rb
Ruby
mit
8,966
main
6,103
# frozen_string_literal: true require "spec_helper" describe CreateCanadaMonthlySalesReportJob do let(:month) { 1 } let(:year) { 2015 } it "raises an argument error if the year is out of bounds" do expect { described_class.new.perform(month, 2013) }.to raise_error(ArgumentError) end it "raises an agru...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/charge_successful_preorders_worker_spec.rb
Ruby
mit
8,966
main
1,125
# frozen_string_literal: true describe ChargeSuccessfulPreordersWorker do describe "#perform" do before do @product = create(:product, price_cents: 600, is_in_preorder_state: true) @preorder_product = create(:preorder_product_with_content, link: @product) @preorder_product.update_attribute(:rel...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/deactivate_integrations_worker_spec.rb
Ruby
mit
8,966
main
2,604
# frozen_string_literal: true require "spec_helper" describe DeactivateIntegrationsWorker do it "calls #deactivate for all integrations" do purchase = create(:free_purchase) [Integrations::CircleIntegrationService, Integrations::DiscordIntegrationService].each do |integration_service| expect_any_inst...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/cancel_subscriptions_for_product_worker_spec.rb
Ruby
mit
8,966
main
1,116
# frozen_string_literal: true describe CancelSubscriptionsForProductWorker do describe "#perform" do before do @product = create(:membership_product, subscription_duration: "monthly", deleted_at: 1.day.ago) @subscription = create(:subscription, link: @product) @product.subscriptions << @subscri...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_auto_invoice_email_job_spec.rb
Ruby
mit
8,966
main
1,515
# frozen_string_literal: true require "spec_helper" describe SendAutoInvoiceEmailJob do let(:buyer) { create(:user) } let(:product) { create(:product) } let(:purchase) { create(:purchase, link: product, purchaser: buyer) } context "when the buyer has billing details with auto-email enabled" do before do ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/generate_financial_reports_for_previous_quarter_job_spec.rb
Ruby
mit
8,966
main
2,007
# frozen_string_literal: true require "spec_helper" describe GenerateFinancialReportsForPreviousQuarterJob do describe ".perform" do it "does not generate any reports when the Rails environment is not production" do described_class.new.perform expect(CreateVatReportJob.jobs.size).to eq(0) exp...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/reindex_recommendable_products_worker_spec.rb
Ruby
mit
8,966
main
2,142
# frozen_string_literal: true require "spec_helper" describe ReindexRecommendableProductsWorker do it "updates time-dependent fields" do freeze_time products = create_list(:product, 5) allow(products[0]).to receive(:recommendable?).and_return(true) create(:purchase, link: products[0]) allow(pr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_taxonomy_stats_job_spec.rb
Ruby
mit
8,966
main
1,676
# frozen_string_literal: true require "spec_helper" describe UpdateTaxonomyStatsJob do describe "#perform" do it "updates the taxonomy stats" do recreate_model_index(Purchase) product_1 = create(:product, taxonomy: Taxonomy.find_by_path(["3d", "3d-modeling"])) product_2 = create(:product, taxo...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_currencies_worker_spec.rb
Ruby
mit
8,966
main
532
# frozen_string_literal: true require "spec_helper" describe UpdateCurrenciesWorker, :vcr do describe "#perform" do before do @worker_instance = described_class.new end it "updates currencies for current date" do @worker_instance.currency_namespace.set("AUD", "0.1111") expect(@worker_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/internal_notification_worker_spec.rb
Ruby
mit
8,966
main
1,148
# frozen_string_literal: true require "spec_helper" describe InternalNotificationWorker do describe "#perform" do it "sends an email via InternalNotificationMailer" do mailer = double("mailer") expect(InternalNotificationMailer).to receive(:notify).with( room_name: "payments", sender...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/generate_fees_by_creator_location_report_job_spec.rb
Ruby
mit
8,966
main
7,544
# frozen_string_literal: true require "spec_helper" describe GenerateFeesByCreatorLocationReportJob do let(:month) { 8 } let(:year) { 2022 } it "raises an argument error if the year is out of bounds" do expect { described_class.new.perform(month, 2013) }.to raise_error(ArgumentError) end it "raises an...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/suspend_users_worker_spec.rb
Ruby
mit
8,966
main
5,506
# frozen_string_literal: true describe SuspendUsersWorker do describe "#perform" do let(:admin_user) { create(:admin_user) } let(:not_reviewed_user) { create(:user) } let(:compliant_user) { create(:compliant_user) } let(:already_suspended_user) { create(:user, user_risk_state: :suspended_for_fraud) }...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/find_subscriptions_with_missing_charge_worker_spec.rb
Ruby
mit
8,966
main
4,887
# frozen_string_literal: true require "spec_helper" describe FindSubscriptionsWithMissingChargeWorker do describe "#perform" do before do described_class.jobs.clear RecurringChargeWorker.jobs.clear end context "without a batch_number" do it "queues a job for each of the 10 batches" do...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/calculate_sale_numbers_worker_spec.rb
Ruby
mit
8,966
main
1,003
# frozen_string_literal: true require "spec_helper" describe CalculateSaleNumbersWorker, :vcr do describe "#perform" do it "sets the correct values for `total_made` and `number_of_creators` in Redis" do create(:failed_purchase, link: create(:product, price_cents: 99)) create(:refunded_purchase, link...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/force_finish_long_running_community_chat_recap_runs_job_spec.rb
Ruby
mit
8,966
main
2,250
# frozen_string_literal: true require "spec_helper" RSpec.describe ForceFinishLongRunningCommunityChatRecapRunsJob do let(:job) { described_class.new } describe "#perform" do let(:recap_run) { create(:community_chat_recap_run) } let(:community) { create(:community) } let!(:recap) { create(:community_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_old_versions_records_worker_spec.rb
Ruby
mit
8,966
main
677
# frozen_string_literal: true require "spec_helper" describe DeleteOldVersionsRecordsWorker, :versioning do describe "#perform" do it "deletes targeted rows" do stub_const("#{described_class}::MAX_ALLOWED_ROWS", 8) stub_const("#{described_class}::DELETION_BATCH_SIZE", 1) create_list(:user, 10)...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_community_chat_recap_notifications_job_spec.rb
Ruby
mit
8,966
main
3,093
# frozen_string_literal: true require "spec_helper" RSpec.describe SendCommunityChatRecapNotificationsJob do let(:job) { described_class.new } describe "#perform" do let(:recap_run) { create(:community_chat_recap_run) } let(:seller) { create(:user) } let(:product) { create(:product, user: seller, com...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/block_email_domains_worker_spec.rb
Ruby
mit
8,966
main
636
# frozen_string_literal: true describe BlockEmailDomainsWorker do describe "#perform" do let(:admin_user) { create(:admin_user) } let(:email_domains) { ["example.com", "example.org"] } it "blocks email domains without expiration" do expect(BlockedObject.email_domain.count).to eq(0) described...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/expire_transcoded_videos_job_spec.rb
Ruby
mit
8,966
main
896
# frozen_string_literal: true require "spec_helper" describe ExpireTranscodedVideosJob do describe "#perform" do it "marks old stamped pdfs as deleted" do $redis.set(RedisKey.transcoded_videos_recentness_limit_in_months, 3) record_1 = create(:transcoded_video, last_accessed_at: nil) record_2 =...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/recurring_charge_reminder_worker_spec.rb
Ruby
mit
8,966
main
2,329
# frozen_string_literal: true require "spec_helper" describe RecurringChargeReminderWorker, :vcr do include ManageSubscriptionHelpers before do setup_subscription travel_to @subscription.end_time_of_subscription - 6.days allow_any_instance_of(Subscription).to receive(:send_renewal_reminders?).and_ret...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_integrations_on_tier_change_worker_spec.rb
Ruby
mit
8,966
main
1,302
# frozen_string_literal: true require "spec_helper" describe UpdateIntegrationsOnTierChangeWorker do it "calls #update_on_tier_change for all integrations" do purchase = create(:membership_purchase, purchase_sales_tax_info: PurchaseSalesTaxInfo.create(business_vat_id: 0)) subscription = purchase.subscriptio...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_product_files_worker_spec.rb
Ruby
mit
8,966
main
2,045
# frozen_string_literal: true require "spec_helper" describe DeleteProductFilesWorker do before do stub_const("PUBLIC_STORAGE_CDN_S3_PROXY_HOST", "#{AWS_S3_ENDPOINT}/#{PUBLIC_STORAGE_S3_BUCKET}") @image1 = ActiveStorage::Blob.create_and_upload!(io: fixture_file_upload("smilie.png"), filename: "smilie.png")...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/retry_failed_paypal_payouts_worker_spec.rb
Ruby
mit
8,966
main
782
# frozen_string_literal: true describe RetryFailedPaypalPayoutsWorker do describe "perform" do it "calls `Payouts.create_payments_for_balances_up_to_date_for_users`" do payout_period_end_date = User::PayoutSchedule.manual_payout_end_date failed_payment = create(:payment_failed, user: create(:user), p...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/recalculate_recent_wishlist_follower_count_job_spec.rb
Ruby
mit
8,966
main
1,393
# frozen_string_literal: true require "spec_helper" describe RecalculateRecentWishlistFollowerCountJob do describe "#perform" do let!(:wishlist1) { create(:wishlist) } let!(:wishlist2) { create(:wishlist) } before do create_list(:wishlist_follower, 3, wishlist: wishlist1, created_at: 15.days.ago)...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_large_sellers_sales_count_job_spec.rb
Ruby
mit
8,966
main
2,009
# frozen_string_literal: true require "spec_helper" describe UpdateLargeSellersSalesCountJob do describe "#perform" do let(:user1) { create(:user) } let(:user2) { create(:user) } let(:product1) { create(:product, user: user1) } let(:product2) { create(:product, user: user2) } let!(:large_seller1...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/stripe_create_merchant_accounts_worker_spec.rb
Ruby
mit
8,966
main
11,417
# frozen_string_literal: true require "spec_helper" describe StripeCreateMerchantAccountsWorker, :vcr do describe "perform" do describe "don't queue users who have merchant accounts already" do let(:user_1) { create(:user, user_risk_state: "compliant") } let(:user_compliance_info_1) { create(:user_c...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/email_outstanding_balances_csv_worker_spec.rb
Ruby
mit
8,966
main
462
# frozen_string_literal: true describe EmailOutstandingBalancesCsvWorker do describe "perform" do it "enqueues AccountingMailer.email_outstanding_balances_csv" do allow(Rails.env).to receive(:production?).and_return(true) expect(AccountingMailer).to receive(:email_outstanding_balances_csv).and_retur...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/renew_custom_domain_ssl_certificates_spec.rb
Ruby
mit
8,966
main
989
# frozen_string_literal: true describe RenewCustomDomainSslCertificates do describe "#perform" do before do @obj_double = double("SslCertificates::Renew object") allow(SslCertificates::Renew).to receive(:new).and_return(@obj_double) allow(@obj_double).to receive(:process) end context "...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_product_files_archive_worker_spec.rb
Ruby
mit
8,966
main
10,968
# frozen_string_literal: true require "spec_helper" describe UpdateProductFilesArchiveWorker, :vcr do describe "#perform" do before do @long_file_name = "2d04543f25c2abbea7740c6abf71d07a12abff9b6ef45f1fabab0b6efb4679643f87131f869bbc7a2a146c3730ee57c65839" allow(Rails).to receive(:env).and_return(Ac...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/cache_unreviewed_users_data_worker_spec.rb
Ruby
mit
8,966
main
563
# frozen_string_literal: true require "spec_helper" describe CacheUnreviewedUsersDataWorker do describe "#perform" do it "caches unreviewed users data via the service" do user = create(:user, user_risk_state: "not_reviewed", created_at: 1.year.ago) create(:balance, user:, amount_cents: 15_000) ...