repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/db/migrate/20240724013512_add_deleted_at_index_to_product_files.rb
db/migrate/20240724013512_add_deleted_at_index_to_product_files.rb
# frozen_string_literal: true class AddDeletedAtIndexToProductFiles < ActiveRecord::Migration[7.1] def up change_table :product_files, bulk: true do |t| t.index :deleted_at t.change :id, :bigint, null: false, auto_increment: true t.change :link_id, :bigint t.change :installment_id, :bigi...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/factory_bot_linting_spec.rb
spec/factory_bot_linting_spec.rb
# frozen_string_literal: true require "support/factory_bot_linting.rb" RSpec.describe FactoryBotLinting do it "#process" do expect { described_class.new.process }.to_not raise_error end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/spec_helper.rb
spec/spec_helper.rb
# frozen_string_literal: true ENV["RAILS_ENV"] = "test" BUILDING_ON_CI = !ENV["CI"].nil? require File.expand_path("../config/environment", __dir__) require "capybara/rails" require "capybara/rspec" require "rspec/rails" require "paper_trail/frameworks/rspec" require "pundit/rspec" Dir.glob(Rails.root.join("spec", "s...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/observers/email_delivery_observer_spec.rb
spec/observers/email_delivery_observer_spec.rb
# frozen_string_literal: true require "spec_helper" describe EmailDeliveryObserver do describe ".delivered_email" do let(:message) { instance_double(Mail::Message) } before do allow(EmailDeliveryObserver::HandleEmailEvent).to receive(:perform).with(message).and_return(true) allow(EmailDeliveryO...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/observers/email_delivery_observer/handle_customer_email_info_spec.rb
spec/observers/email_delivery_observer/handle_customer_email_info_spec.rb
# frozen_string_literal: true require "spec_helper" describe EmailDeliveryObserver::HandleCustomerEmailInfo do let(:purchase) { create(:purchase) } describe ".perform" do RSpec.shared_examples "CustomerMailer.receipt" do describe "for a Purchase" do context "when CustomerEmailInfo record doesn'...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/observers/email_delivery_observer/handle_email_event_spec.rb
spec/observers/email_delivery_observer/handle_email_event_spec.rb
# frozen_string_literal: true require "spec_helper" describe EmailDeliveryObserver::HandleEmailEvent do let(:user) { create(:user, email: "user@example.com") } let(:email_digest) { Digest::SHA1.hexdigest(user.email).first(12) } describe ".perform" do it "logs email sent event" do timestamp = Time.cur...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/jobs/delete_unused_public_files_job_spec.rb
spec/jobs/delete_unused_public_files_job_spec.rb
# frozen_string_literal: true require "spec_helper" describe DeleteUnusedPublicFilesJob do it "deletes public files scheduled for deletion" do public_file = create(:public_file, :with_audio, scheduled_for_deletion_at: 1.day.ago) described_class.new.perform public_file.reload expect(public_file).to...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/subdomain_redirector_service_spec.rb
spec/services/subdomain_redirector_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SubdomainRedirectorService do let(:service) { described_class.new } describe "#update" do it "sets the config in redis" do config = "live.gumroad.com=example.com\ntwitter.gumroad.com=twitter.com/gumroad" service.update(config) re...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/admin_search_service_spec.rb
spec/services/admin_search_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe AdminSearchService do describe "#search_purchases" do it "returns no Purchases if query is invalid" do purchases = AdminSearchService.new.search_purchases(query: "invalidquery") expect(purchases.size).to eq(0) end it "returns pur...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/helper_user_info_service_spec.rb
spec/services/helper_user_info_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe HelperUserInfoService do include Rails.application.routes.url_helpers let(:user) { create(:user, email: "user@example.com") } describe "#customer_info" do let(:service) { described_class.new(email: user.email) } it "retrieves user info" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/vat_validation_service_spec.rb
spec/services/vat_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe VatValidationService, :vcr do describe "#process" do it "returns false when provided vat is nil" do expect(described_class.new(nil).process).to be(false) end it "returns false when invalid vat is provided" do expect(described_clas...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/discord_api_spec.rb
spec/services/discord_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe DiscordApi do describe "POST oauth_token" do it "makes an oauth authorization request with the given code and redirect uri" do WebMock.stub_request(:post, DISCORD_OAUTH_TOKEN_URL). with( body: { grant_type: "authori...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/tra_tin_validation_service_spec.rb
spec/services/tra_tin_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe TraTinValidationService do it "returns true when valid Tanzania TIN is provided" do tin = "12-345678-A" expect(described_class.new(tin).process).to be(true) end it "returns false when nil TIN is provided" do expect(described_class.new(nil...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/home_page_link_service_spec.rb
spec/services/home_page_link_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe HomePageLinkService do shared_examples_for "home page link" do |page| describe ".#{page}" do it "returns the full URL of the page" do expect(described_class.public_send(page)).to eq "#{UrlService.root_domain_with_protocol}/#{page}" ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/url_service_spec.rb
spec/services/url_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe UrlService do describe "#domain_with_protocol" do it "returns domain with protocol" do expect(UrlService.domain_with_protocol).to eq "#{PROTOCOL}://#{DOMAIN}" end end describe "#api_domain_with_protocol" do it "returns domain with p...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/offer_code_discount_computing_service_spec.rb
spec/services/offer_code_discount_computing_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe OfferCodeDiscountComputingService do let(:seller) { create(:user) } let(:product) { create(:product, user: seller, price_cents: 2000, price_currency_type: "usd") } let(:product2) { create(:product, user: seller, price_cents: 2000, price_currency_type:...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/purchasing_power_parity_service_spec.rb
spec/services/purchasing_power_parity_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe PurchasingPowerParityService do before do @namespace = Redis::Namespace.new(:ppp, redis: $redis) @service = described_class.new @seller = create(:user) end describe "#get_factor" do before do @namespace.set("FAKE", "0.9876543210...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/pdf_stamping_service_spec.rb
spec/services/pdf_stamping_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe PdfStampingService do describe ".can_stamp_file?" do let(:product_file) { instance_double("ProductFile") } before do allow(PdfStampingService::Stamp).to receive(:can_stamp_file?).and_return(true) end it "calls can_stamp_file? on Pd...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/mailer_attachment_or_link_service_spec.rb
spec/services/mailer_attachment_or_link_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe MailerAttachmentOrLinkService do describe "#perform" do before do @file = fixture_file_upload("test.png") end it "generates URL with given file when size is greater than 10 MB" do allow(@file).to receive(:size).and_return(MailerAt...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/seller_mobile_analytics_service_spec.rb
spec/services/seller_mobile_analytics_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SellerMobileAnalyticsService do before do @user = create(:user, timezone: "UTC") @product = create(:product, user: @user) end describe "#process" do it "returns the proper purchase data for all time" do valid_purchases = [] tr...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/save_content_upsells_service_spec.rb
spec/services/save_content_upsells_service_spec.rb
# frozen_string_literal: true describe SaveContentUpsellsService do let(:seller) { create(:user) } let(:product) { create(:product, user: seller, price_cents: 1000) } let(:variant_category) { create(:variant_category, link: product) } let(:variant) { create(:variant, variant_category:) } describe "#from_htm...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/post_sendgrid_api_spec.rb
spec/services/post_sendgrid_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe PostSendgridApi, :freeze_time do include Rails.application.routes.url_helpers before do @seller = create(:named_user) @post = create(:audience_installment, name: "post title", message: "post body", seller: @seller) described_class.mails.cle...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product_duplicator_service_spec.rb
spec/services/product_duplicator_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe ProductDuplicatorService do let(:seller) { create(:user) } let(:s3_url) { "#{AWS_S3_ENDPOINT}/#{S3_BUCKET}/specs/magic.mp3" } let(:product) do product_params = { user: seller, price_cents: 5000, name: "test product", descrip...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/recommended_products_service_spec.rb
spec/services/recommended_products_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe RecommendedProductsService do describe ".fetch" do let(:seller) { create(:user) } let!(:sample_product) { create(:product, user: seller) } let!(:product1) { create(:product, name: "Product 1", user: seller) } let!(:product2) { create(:prod...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/adult_keyword_detector_spec.rb
spec/services/adult_keyword_detector_spec.rb
# frozen_string_literal: true require "spec_helper" describe AdultKeywordDetector do it "classifies adult text as such" do ["nude2screen", "PussyStuff", "abs punch product", "futa123", "uncensored", "Click here for #HotHentaiComics!"].each do |text| expect(described_class.adult?(t...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/community_chat_recap_generator_service_spec.rb
spec/services/community_chat_recap_generator_service_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe CommunityChatRecapGeneratorService do let(:seller) { create(:user) } let(:community) { create(:community, seller:) } describe "#process" do context "when recap is already finished" do let(:community_chat_recap) { create(:community_cha...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/save_utm_link_service_spec.rb
spec/services/save_utm_link_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SaveUtmLinkService do let(:seller) { create(:user) } let(:product) { create(:product, user: seller) } let(:post) { create(:audience_post, :published, shown_on_profile: true, seller:) } describe "#perform" do context "when 'utm_link' is not prov...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/gumroad_daily_analytics_compiler_spec.rb
spec/services/gumroad_daily_analytics_compiler_spec.rb
# frozen_string_literal: true require "spec_helper" describe GumroadDailyAnalyticsCompiler do describe ".compile_gumroad_price_cents" do it "aggregates data for the dates provided" do create :purchase, created_at: Time.utc(2023, 1, 4) create :purchase, created_at: Time.utc(2023, 1, 5) create :...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/admin_funds_csv_report_service_spec.rb
spec/services/admin_funds_csv_report_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe AdminFundsCsvReportService do describe ".generate" do subject(:csv_report) { described_class.new(@report).generate } context "for funds received report" do before do @report = FundsReceivedReports.funds_received_report(1, 2022) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/post_resend_api_spec.rb
spec/services/post_resend_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe PostResendApi, :freeze_time do include Rails.application.routes.url_helpers before do @seller = create(:named_user) @post = create(:audience_installment, name: "post title", message: "post body", seller: @seller) described_class.mails.clear...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/merge_carts_service_spec.rb
spec/services/merge_carts_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe MergeCartsService do describe "#process" do let!(:user) { create(:user) } let(:browser_guid) { SecureRandom.uuid } context "when source cart is nil" do it "updates the details of the target cart" do cart = create(:cart, user:, b...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/default_abandoned_cart_workflow_generator_service_spec.rb
spec/services/default_abandoned_cart_workflow_generator_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe DefaultAbandonedCartWorkflowGeneratorService do include Rails.application.routes.url_helpers let(:seller) { create(:user) } subject { described_class.new(seller:) } describe "#generate" do context "when seller does not have an abandoned cart ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/cleanup_rpush_device_service_spec.rb
spec/services/cleanup_rpush_device_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe CleanupRpushDeviceService do before do @device_a = create(:device) @device_b = create(:device) @device_c = create(:device) end it "removes device records for the undeliverable token" do apn_feedback = double(device_token: @device_b.to...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/custom_domain_verification_service_spec.rb
spec/services/custom_domain_verification_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe CustomDomainVerificationService do let(:domain) { "example.com" } subject(:service) { described_class.new(domain:) } describe "#process" do describe "domain CNAME configuration" do let(:domain) { "store.example.com" } context "when t...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/purchase_search_service_spec.rb
spec/services/purchase_search_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe PurchaseSearchService do describe "#process" do it "can filter by seller" do purchase_1 = create(:purchase) purchase_2 = create(:purchase, link: purchase_1.link) # same seller as purchase_1 seller_1 = purchase_1.seller purchase...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/mvn_validation_service_spec.rb
spec/services/mvn_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe MvaValidationService do before do @vatstack_response = { "id" => "5e5a894fa5807929777ad9c7", "active" => true, "company_address" => "Søndre gate 15, 7011 TRONDHEIM", "company_name" => "DANSKE BANK", "company_type" => "NUF...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/trn_validation_service_spec.rb
spec/services/trn_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe TrnValidationService do it "returns true when valid TRN is provided" do trn_id = "123456789012345" expect(described_class.new(trn_id).process).to be(true) end it "returns false when nil TRN is provided" do expect(described_class.new(nil)....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/redis_key_spec.rb
spec/services/redis_key_spec.rb
# frozen_string_literal: true require "spec_helper" describe RedisKey do describe ".ai_request_throttle" do it "returns a properly formatted redis key with user id" do user_id = 123 key = described_class.ai_request_throttle(user_id) expect(key).to eq("ai_request_throttle:123") end it...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/stripe_tax_forms_api_spec.rb
spec/services/stripe_tax_forms_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe StripeTaxFormsApi, vcr: { cassette_name: "StripeTaxFormsApi/tax_forms" } do let(:stripe_account_id) { "acct_1234567890" } let(:form_type) { "us_1099_k" } let(:year) { 2024 } let(:service) { described_class.new(stripe_account_id:, form_type:, year:) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product_indexing_service_spec.rb
spec/services/product_indexing_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe ProductIndexingService do before do @product = create(:product) end describe "#perform" do it "can index documents" do # Empty the index for the purpose of this test recreate_model_indices(Link) described_class.perform(prod...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/email_redactor_service_spec.rb
spec/services/email_redactor_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe EmailRedactorService do it "redacts short emails" do expect(EmailRedactorService.redact("foo@bar.baz")).to eq("f*o@b**.baz") end it "redacts 1 char emails" do expect(EmailRedactorService.redact("a@b.co")).to eq("a@b.co") end it "redacts ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/firs_tin_validation_service_spec.rb
spec/services/firs_tin_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe FirsTinValidationService do it "returns true when valid FIRS TIN is provided" do firs_tin = "12345678-1234" expect(described_class.new(firs_tin).process).to be(true) end it "returns false when nil FIRS TIN is provided" do expect(described...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/tax_id_validation_service_spec.rb
spec/services/tax_id_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe TaxIdValidationService, :vcr do let(:tax_id) { "528491" } let(:country_code) { "IS" } it "returns true when a valid tax id is provided" do expect(described_class.new(tax_id, country_code).process).to be(true) end it "returns false when the t...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/black_friday_stats_service_spec.rb
spec/services/black_friday_stats_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe BlackFridayStatsService do describe ".calculate_stats" do it "returns placeholder values with zero counts" do stats = described_class.calculate_stats expect(stats[:active_deals_count]).to eq(0) expect(stats[:revenue_cents]).to eq(0)...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/user_custom_domain_request_service_spec.rb
spec/services/user_custom_domain_request_service_spec.rb
# frozen_string_literal: true describe UserCustomDomainRequestService do describe "#valid?" do let(:request) { double("request") } it "returns false when request is from Gumroad domain" do allow(request).to receive(:host).and_return("app.test.gumroad.com") expect(UserCustomDomainRequestService.v...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/email_suppression_manager_spec.rb
spec/services/email_suppression_manager_spec.rb
# frozen_string_literal: true require "spec_helper" describe EmailSuppressionManager, :vcr do let(:email) { "sam@example.com" } describe "#unblock_email" do let(:lists) { [:bounces, :spam_reports] } it "scans all lists even if the email is found in one of the lists in between" do allow_any_instanc...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/tip_options_services_spec.rb
spec/services/tip_options_services_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe TipOptionsService, type: :service do describe ".get_tip_options" do context "when Redis has valid tip options" do before do $redis.set(RedisKey.tip_options, "[10, 20, 30]") end it "returns the parsed tip options" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/notion_api_spec.rb
spec/services/notion_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe NotionApi, :vcr do let(:user) { create(:user, email: "user@example.com") } describe "#get_bot_token" do before do allow(GlobalConfig).to receive(:get).and_return(nil) allow(GlobalConfig).to receive(:get).with("NOTION_OAUTH_CLIENT_ID").a...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/gst_validation_service_spec.rb
spec/services/gst_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe GstValidationService do it "returns true when valid a gst id is provided" do gst_id = "T9100001B" success_response = { "returnCode" => "10", "data" => { "gstRegistrationNumber" => "T9100001B", "name" => "GUMROAD, INC."...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/forfeit_balance_service_spec.rb
spec/services/forfeit_balance_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe ForfeitBalanceService do let(:user) { create(:named_user) } let(:merchant_account) { create(:merchant_account, user:, charge_processor_id: StripeChargeProcessor.charge_processor_id) } context "country_change" do before do @service = Forfeit...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/rpush_fcm_app_service_spec.rb
spec/services/rpush_fcm_app_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe RpushFcmAppService do let!(:app_name) { Device::APP_TYPES[:consumer] } describe "#first_or_create!" do before do Rpush::Fcm::App.all.each(&:destroy) Modis.with_connection do |redis| redis.flushdb end end context "...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/username_generator_service_spec.rb
spec/services/username_generator_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe UsernameGeneratorService do describe "#username" do let(:user) { build(:user, email: "johnsmith@gmail.com") } let(:username_generator) { described_class.new(user) } it "returns a username generated by OpenAI", :vcr do expect(username_ge...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/sitemap_service_spec.rb
spec/services/sitemap_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SitemapService do let(:service) { described_class.new } describe "#generate" do before do @product = create(:product, created_at: Time.current) end it "generates the sitemap" do date = @product.created_at sitemap_file_pat...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/payout_users_service_spec.rb
spec/services/payout_users_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe PayoutUsersService, :vcr do let!(:payout_date) { Date.yesterday } let(:user1) { create(:user, should_paypal_payout_be_split: true) } let(:user2) { create(:user) } before do create(:tos_agreement, user: user1) create(:user_compliance_info, u...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/safe_redirect_path_service_spec.rb
spec/services/safe_redirect_path_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe "SafeRedirectPathService" do before do @request = OpenStruct.new(host: "test.gumroad.com") end let(:service) { SafeRedirectPathService.new(@path, @request) } describe "#process" do context "when path has a subdomain host" do before d...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/post_email_api_spec.rb
spec/services/post_email_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe PostEmailApi do let(:seller) { create(:named_user) } let(:post) { create(:audience_installment, seller: seller) } let(:recipients) do 10.times.map { |i| { email: "recipient#{i}@gumroad-example.com" } } end let(:args) { { post: post, recipients...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/update_user_country_spec.rb
spec/services/update_user_country_spec.rb
# frozen_string_literal: true require "spec_helper" describe UpdateUserCountry do before do @user = create(:named_user) create(:ach_account_stripe_succeed, user: @user) create(:ach_account, user: @user) create(:user_compliance_info, user: @user) create(:merchant_account, user: @user, charge_proc...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/recommended_wishlists_service_spec.rb
spec/services/recommended_wishlists_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe RecommendedWishlistsService do describe ".fetch" do let!(:wishlists) do 5.times.map { |i| create(:wishlist, name: "Recommendable #{i}", recent_follower_count: i, recommendable: true) } end let(:recommended_products) { create_list(:produ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/robots_service_spec.rb
spec/services/robots_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe RobotsService do before do @redis_namespace = Redis::Namespace.new(:robots_redis_namespace, redis: $redis) @sitemap_config = "Sitemap: https://test-public-files.gumroad.com/products/sitemap.xml" @user_agent_rules = ["User-agent: *", "Disallow:...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/save_installment_service_spec.rb
spec/services/save_installment_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SaveInstallmentService do let(:seller) { create(:user) } let(:installment) { nil } let(:product) { create(:product, user: seller) } let(:params) do ActionController::Parameters.new( installment: { affiliate_products: nil, a...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/kra_pin_validation_service_spec.rb
spec/services/kra_pin_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe KraPinValidationService do it "returns true when valid KRA PIN is provided" do kra_pin = "A123456789P" expect(described_class.new(kra_pin).process).to be(true) end it "returns false when nil KRA PIN is provided" do expect(described_class....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/balances_by_product_service_spec.rb
spec/services/balances_by_product_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe BalancesByProductService do include CollabProductHelper describe "#process" do let(:user) { create(:user) } before do (0...5).each do |i| product = create(:product, user:, name: "product #{i}", purchase_disabled_at: i == 4 ? Time...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/circle_api_spec.rb
spec/services/circle_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe CircleApi, :vcr, :without_circle_rate_limit do let(:communities_list) do [ { "id" => 3512, "name" => "Gumroad", "slug" => "gumroad", "icon_url" => "https://d2y5h3osumboay.cloudfront.net/o4431o822um5prcmyefm7pc9fhht", "log...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/expiring_s3_file_service_spec.rb
spec/services/expiring_s3_file_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe ExpiringS3FileService do describe "#perform" do before do @file = fixture_file_upload("test.png") stub_const("S3_BUCKET", "gumroad-specs") end it "generates URL with given data and default values" do result = ExpiringS3FileS...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/secure_encrypt_service_spec.rb
spec/services/secure_encrypt_service_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe SecureEncryptService do let(:key) { SecureRandom.random_bytes(32) } let(:text) { "this is a secret message" } before do allow(GlobalConfig).to receive(:get).with("SECURE_ENCRYPT_KEY").and_return(key) # Reset memoized encryptor descr...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/installment_search_service_spec.rb
spec/services/installment_search_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe InstallmentSearchService do describe "#process" do it "can filter by seller" do product_1 = create(:product) installment_1 = create(:installment, link: product_1) installment_2 = create(:installment, link: product_1) creator_1 ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/qst_validation_service_spec.rb
spec/services/qst_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe QstValidationService, :vcr do let(:qst_id) { "1002092821TQ0001" } it "returns true when a valid qst id is provided" do expect(described_class.new(qst_id).process).to be(true) end it "returns false when the qst id is nil" do expect(describe...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/rpush_apns_app_service_spec.rb
spec/services/rpush_apns_app_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe RpushApnsAppService do let!(:app_name) { Device::APP_TYPES[:creator] } describe "#first_or_create!" do before do Rpush::Apns2::App.all.each(&:destroy) end context "when the record exists" do it "returns the record" do a...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/user_balance_stats_service_spec.rb
spec/services/user_balance_stats_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe UserBalanceStatsService do let(:user) { create(:user) } let(:instance) { described_class.new(user:) } let(:example_values) { { foo: "bar", nested: { key1: { key2: "value2" } }, records: [{ id: 1, name: "first" }, { id: 2, name: "second" }] } } desc...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/google_calendar_api_spec.rb
spec/services/google_calendar_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe GoogleCalendarApi do describe "POST oauth_token" do it "makes an oauth authorization request with the given code and redirect uri" do WebMock.stub_request(:post, "#{GoogleCalendarApi::GOOGLE_CALENDAR_OAUTH_URL}/token"). with( b...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/zoom_api_spec.rb
spec/services/zoom_api_spec.rb
# frozen_string_literal: true require "spec_helper" describe ZoomApi do let(:oauth_request_header) do client_id = GlobalConfig.get("ZOOM_CLIENT_ID") client_secret = GlobalConfig.get("ZOOM_CLIENT_SECRET") token = Base64.strict_encode64("#{client_id}:#{client_secret}") { "Authorization" => "Basic #{t...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/oman_vat_number_validation_service_spec.rb
spec/services/oman_vat_number_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe OmanVatNumberValidationService do it "returns true when valid VAT number is provided" do vat_number = "OM1234567890" expect(described_class.new(vat_number).process).to be(true) end it "returns false when nil VAT number is provided" do exp...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/save_public_files_service_spec.rb
spec/services/save_public_files_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SavePublicFilesService do let(:seller) { create(:user) } let(:product) { create(:product, user: seller) } let!(:public_file1) { create(:public_file, :with_audio, resource: product, display_name: "Audio 1") } let!(:public_file2) { create(:public_file...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/abn_validation_service_spec.rb
spec/services/abn_validation_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe AbnValidationService do before do @vatstack_response = { "active" => true, "company_address" => "NSW 2020", "company_name" => "KANGAROO AIRWAYS LIMITED", "company_type" => "PUB", "consultation_number" => nil, "count...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/instant_payouts_service_spec.rb
spec/services/instant_payouts_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe InstantPayoutsService, :vcr do let(:seller) { create(:compliant_user) } before do create(:tos_agreement, user: seller) create(:user_compliance_info, user: seller) create_list(:payment_completed, 4, user: seller) end describe "#perform"...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/save_files_service_spec.rb
spec/services/save_files_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SaveFilesService do before do @product = create(:product) end subject(:service) { described_class } describe ".perform" do context "when params is empty" do it "does not raise an error" do service.perform(@product, {}) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/subscribe_preview_generator_service_spec.rb
spec/services/subscribe_preview_generator_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe SubscribePreviewGeneratorService, type: :system, js: true do describe "#generate_pngs" do before do @user1 = create(:user, name: "User 1", username: "user1") @user2 = create(:user, name: "User 2", username: "user2") visit user_subscr...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/ai/product_details_generator_service_spec.rb
spec/services/ai/product_details_generator_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Ai::ProductDetailsGeneratorService, :vcr do let(:current_seller) { create(:user) } let(:service) { described_class.new(current_seller:) } describe "#generate_product_details" do let(:prompt) { "Create a coding tutorial ebook about Ruby on Rails f...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/push_notification_service/ios_spec.rb
spec/services/push_notification_service/ios_spec.rb
# frozen_string_literal: true require "spec_helper" describe PushNotificationService::Ios do describe "creator app" do it "creates an APNS notification" do app = double("apns_app") allow(PushNotificationService::Ios).to receive(:creator_app).and_return(app) device_token = "ABC" title = ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/push_notification_service/android_spec.rb
spec/services/push_notification_service/android_spec.rb
# frozen_string_literal: true require "spec_helper" describe PushNotificationService::Android do before do Feature.activate(:send_notifications_to_android_devices) end describe "consumer app" do context "when notification sound is passed" do it "creates a FCM notification with sound" do a...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/handle_email_event_info/for_receipt_email_spec.rb
spec/services/handle_email_event_info/for_receipt_email_spec.rb
# frozen_string_literal: true describe HandleEmailEventInfo::ForReceiptEmail do let!(:preorder) { create(:preorder) } let(:purchase) { create(:purchase) } def handler_class_for(email_provider) case email_provider when :sendgrid then HandleSendgridEventJob when :resend then HandleResendEventJob e...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/handle_email_event_info/for_abandoned_cart_email_spec.rb
spec/services/handle_email_event_info/for_abandoned_cart_email_spec.rb
# frozen_string_literal: true describe HandleEmailEventInfo::ForAbandonedCartEmail do let!(:abandoned_cart_workflow1) { create(:abandoned_cart_workflow) } let(:abandoned_cart_workflow_installment1) { abandoned_cart_workflow1.alive_installments.sole } let!(:abandoned_cart_workflow2) { create(:abandoned_cart_workf...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/handle_email_event_info/for_installment_email_spec.rb
spec/services/handle_email_event_info/for_installment_email_spec.rb
# frozen_string_literal: true describe HandleEmailEventInfo::ForInstallmentEmail do before do @installment = create(:installment) @purchase = create(:purchase) @identifier = "[#{@purchase.id}, #{@installment.id}]" end describe ".perform" do it "creates a new CreatorEmailOpenEvent object" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/integrations/circle_integration_service_spec.rb
spec/services/integrations/circle_integration_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Integrations::CircleIntegrationService, :without_circle_rate_limit do let(:community_id) { 3512 } let(:space_group_id) { 43576 } let(:email) { "test_circle_integration@gumroad.com" } before do @user = create(:user, email:) @integration = cr...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/integrations/base_integration_service_spec.rb
spec/services/integrations/base_integration_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Integrations::BaseIntegrationService do it "raises runtime error on direct instantiation" do expect { Integrations::BaseIntegrationService.new }.to raise_error(RuntimeError, "Integrations::BaseIntegrationService should not be instantiated. Instantiate...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/integrations/discord_integration_service_spec.rb
spec/services/integrations/discord_integration_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Integrations::DiscordIntegrationService do let(:integration) { create(:discord_integration) } let(:server_id) { integration.server_id } let(:user_id) { "694641779777077339" } let(:regular_user_role_id) { "111111111111111111" } let(:gumroad_bot_rol...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/exports/audience_export_service_spec.rb
spec/services/exports/audience_export_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Exports::AudienceExportService do describe "#perform" do let!(:user) { create(:user) } let!(:follower) { create(:active_follower, email: "follower@gumroad.com", user: user, created_at: 1.day.ago) } let(:product) { create(:product, user: user, ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/exports/purchase_export_service_spec.rb
spec/services/exports/purchase_export_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Exports::PurchaseExportService do describe "#perform" do before do @seller = create(:user) @product = create(:product, user: @seller, price_cents: 100_00) @purchase = create(:purchase, link: @product, street_address: "Søéad", full_na...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/exports/affiliate_export_service_spec.rb
spec/services/exports/affiliate_export_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Exports::AffiliateExportService do describe "#perform" do before do @product = create(:product, price_cents: 10_00, name: "Product 1") @seller = @product.user @affiliate_user = create(:affiliate_user, email: "affiliate@gumroad.com", ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/exports/payouts/csv_spec.rb
spec/services/exports/payouts/csv_spec.rb
# frozen_string_literal: true require "spec_helper" describe Exports::Payouts::Csv, :vcr do describe "perform" do let!(:now) { Time.current } let!(:payout_date) { 1.week.ago } let(:payout_processor_type) { PayoutProcessorType::PAYPAL } before do @seller = create :named_user @another_sel...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/exports/payouts/annual_spec.rb
spec/services/exports/payouts/annual_spec.rb
# frozen_string_literal: true require "spec_helper" describe Exports::Payouts::Annual, :vcr do include PaymentsHelper describe "perform" do let!(:year) { 2019 } before do @user = create(:user) date_for_year = Date.new(year) amount_cents = 1500 (0..11).each do |month| creat...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/exports/tax_summary/payable_spec.rb
spec/services/exports/tax_summary/payable_spec.rb
# frozen_string_literal: true require "spec_helper" describe Exports::TaxSummary::Payable, :vcr do include PaymentsHelper describe "perform" do let!(:year) { 2019 } before do date_in_year = Date.new(year) @user = create(:user) @compliance_info = create(:user_compliance_info, user: @user...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/exports/tax_summary/annual_spec.rb
spec/services/exports/tax_summary/annual_spec.rb
# frozen_string_literal: true require "spec_helper" describe Exports::TaxSummary::Annual, :vcr do include PaymentsHelper describe "perform" do let!(:year) { 2019 } before do date_in_year = Date.new(year) @user = create(:user) @compliance_info = create(:user_compliance_info, user: @user)...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product/compute_call_availabilities_service_spec.rb
spec/services/product/compute_call_availabilities_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Product::ComputeCallAvailabilitiesService, :freeze_time do let(:seller) { create(:user, :eligible_for_service_products) } let(:call_product) { create(:call_product, user: seller) } let(:call_limitation_info) { call_product.call_limitation_info } le...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product/save_post_purchase_custom_fields_service_spec.rb
spec/services/product/save_post_purchase_custom_fields_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Product::SavePostPurchaseCustomFieldsService do describe "#perform" do let(:product) { create(:product_with_digital_versions, has_same_rich_content_for_all_variants: true) } let!(:long_answer) { create(:custom_field, seller: product.user, product...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product/skus_updater_service_spec.rb
spec/services/product/skus_updater_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Product::SkusUpdaterService do describe ".perform" do before do @product = create(:physical_product, skus_enabled: true) @category1 = create(:variant_category, title: "Size", link: @product) @variant1 = create(:variant, variant_categ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product/save_integrations_service_spec.rb
spec/services/product/save_integrations_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Product::SaveIntegrationsService do let(:product) { create(:product) } def get_integration_class(integration_name) case integration_name when "circle" CircleIntegration when "discord" DiscordIntegration when "zoom" Zoo...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product/bulk_update_support_email_service_spec.rb
spec/services/product/bulk_update_support_email_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Product::BulkUpdateSupportEmailService do let(:user) { create(:user) } let!(:product1) { create(:product, user:, support_email: "old1@example.com") } let!(:product2) { create(:product, user:, support_email: "old2@example.com") } let!(:product3) { c...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product/save_cancellation_discount_service_spec.rb
spec/services/product/save_cancellation_discount_service_spec.rb
# frozen_string_literal: true RSpec.describe Product::SaveCancellationDiscountService do let(:product) { create(:membership_product_with_preset_tiered_pricing) } let(:service) { described_class.new(product, cancellation_discount_params) } describe "#perform" do context "with fixed amount discount" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/services/product/variant_category_updater_service_spec.rb
spec/services/product/variant_category_updater_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe Product::VariantCategoryUpdaterService do describe ".perform" do context "when trying to update a variant from another product" do let(:product) { create(:product) } let(:other_product) { create(:product) } let(:variant) { create(:va...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false