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/spec/models/albania_bank_account_spec.rb | spec/models/albania_bank_account_spec.rb | # frozen_string_literal: true
describe AlbaniaBankAccount do
describe "#bank_account_type" do
it "returns AL" do
expect(create(:albania_bank_account).bank_account_type).to eq("AL")
end
end
describe "#country" do
it "returns AL" do
expect(create(:albania_bank_account).country).to eq("AL")... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/norway_bank_account_spec.rb | spec/models/norway_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe NorwayBankAccount do
describe "#bank_account_type" do
it "returns NO" do
expect(create(:norway_bank_account).bank_account_type).to eq("NO")
end
end
describe "#country" do
it "returns NO" do
expect(create(:norway_bank_account).... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/oauth_application_spec.rb | spec/models/oauth_application_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe OauthApplication do
describe "validity" do
before do
@user = create(:user)
end
it "does not validate name uniqueness" do
create(:oauth_application, owner: @user, name: :foo)
expect(build(:oauth_application, owner: @user, nam... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bank_account_spec.rb | spec/models/bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe BankAccount do
describe "routing_number" do
let(:australian_bank_account) { build(:australian_bank_account) }
it "returns the decrypted account number" do
expect(australian_bank_account.send(:account_number_decrypted)).to eq("1234567")
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/oman_bank_account_spec.rb | spec/models/oman_bank_account_spec.rb | # frozen_string_literal: true
describe OmanBankAccount do
describe "#bank_account_type" do
it "returns OM" do
expect(create(:oman_bank_account).bank_account_type).to eq("OM")
end
end
describe "#country" do
it "returns OM" do
expect(create(:oman_bank_account).country).to eq("OM")
end
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/comment_spec.rb | spec/models/comment_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Comment do
describe "validations" do
describe "content length" do
context "when content is within the configured character limit" do
subject(:comment) { build(:comment, commentable: create(:published_installment), content: "a" * 10_000) ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_files_archive_spec.rb | spec/models/product_files_archive_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ProductFilesArchive do
describe "callbacks" do
it "saves `digest` when transitioning to the 'in_progress' state" do
product = create(:product_with_files)
product_files_archive = product.product_files_archives.create!(product_files: product... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/korea_bank_account_spec.rb | spec/models/korea_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe KoreaBankAccount do
describe "#bank_account_type" do
it "returns korea" do
expect(create(:korea_bank_account).bank_account_type).to eq("KR")
end
end
describe "#country" do
it "returns KR" do
expect(create(:korea_bank_account).... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/community_notification_setting_spec.rb | spec/models/community_notification_setting_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe CommunityNotificationSetting do
subject(:notification_setting) { build(:community_notification_setting) }
describe "associations" do
it { is_expected.to belong_to(:user) }
it { is_expected.to belong_to(:seller).class_name("User") }
end
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/mauritius_bank_account_spec.rb | spec/models/mauritius_bank_account_spec.rb | # frozen_string_literal: true
describe MauritiusBankAccount do
describe "#bank_account_type" do
it "returns MU" do
expect(create(:mauritius_bank_account).bank_account_type).to eq("MU")
end
end
describe "#country" do
it "returns MA" do
expect(create(:mauritius_bank_account).country).to eq... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/dispute_evidence_spec.rb | spec/models/dispute_evidence_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe DisputeEvidence do
let(:dispute_evidence) do
DisputeEvidence.create!(
dispute: create(:dispute),
purchased_at: "",
customer_purchase_ip: "",
customer_email: " joe@example.com",
customer_name: " Joe Doe ",
billing_ad... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/taiwan_bank_account_spec.rb | spec/models/taiwan_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe TaiwanBankAccount do
describe "#bank_account_type" do
it "returns Taiwan" do
expect(create(:taiwan_bank_account).bank_account_type).to eq("TW")
end
end
describe "#country" do
it "returns TW" do
expect(create(:taiwan_bank_accou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/discord_integration_spec.rb | spec/models/discord_integration_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe DiscordIntegration do
it "creates the correct json details" do
integration = create(:discord_integration)
DiscordIntegration::INTEGRATION_DETAILS.each do |detail|
expect(integration.respond_to?(detail)).to eq true
end
end
it "saves ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/armenia_bank_account_spec.rb | spec/models/armenia_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ArmeniaBankAccount do
describe "#bank_account_type" do
it "returns AM" do
expect(create(:armenia_bank_account).bank_account_type).to eq("AM")
end
end
describe "#country" do
it "returns AM" do
expect(create(:armenia_bank_accoun... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/mexico_bank_account_spec.rb | spec/models/mexico_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe MexicoBankAccount do
describe "#bank_account_type" do
it "returns mexico" do
expect(create(:mexico_bank_account).bank_account_type).to eq("MX")
end
end
describe "#country" do
it "returns MX" do
expect(create(:mexico_bank_accou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/cote_d_ivoire_bank_account_spec.rb | spec/models/cote_d_ivoire_bank_account_spec.rb | # frozen_string_literal: true
describe CoteDIvoireBankAccount do
describe "#bank_account_type" do
it "returns CI" do
expect(create(:cote_d_ivoire_bank_account).bank_account_type).to eq("CI")
end
end
describe "#country" do
it "returns CI" do
expect(create(:cote_d_ivoire_bank_account).coun... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_page_view_spec.rb | spec/models/product_page_view_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ProductPageView do
it "can have documents added to its index" do
document_id = SecureRandom.uuid
EsClient.index(
index: described_class.index_name,
id: document_id,
body: {
"product_id" => 123,
"seller_id" => 456,... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/credit_spec.rb | spec/models/credit_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Credit do
describe "create_for_credit!" do
let(:user) { create(:user) }
let(:merchant_account) { create(:merchant_account, user:) }
it "assigns to the Gumroad Stripe merchant account" do
credit = Credit.create_for_credit!(user:, amount_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/new_zealand_bank_account_spec.rb | spec/models/new_zealand_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe NewZealandBankAccount do
describe "#bank_account_type" do
it "returns new zealand" do
expect(create(:new_zealand_bank_account).bank_account_type).to eq("NZ")
end
end
describe "#country" do
it "returns NZ" do
expect(create(:new... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_file_spec.rb | spec/models/product_file_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ProductFile do
describe ".archivable" do
it "only includes archivable files" do
create(:streamable_video)
create(:readable_document)
create(:listenable_audio)
create(:non_readable_document)
create(:external_link)
cr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/card_bank_account_spec.rb | spec/models/card_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe CardBankAccount, :vcr do
it "only allows debit cards" do
card_bank_account = create(:card_bank_account)
expect(card_bank_account.credit_card.funding_type).to eq(ChargeableFundingType::DEBIT)
expect(card_bank_account.valid?).to be(true)
ca... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/last_read_community_chat_message_spec.rb | spec/models/last_read_community_chat_message_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe LastReadCommunityChatMessage do
subject(:last_read_message) { build(:last_read_community_chat_message) }
describe "associations" do
it { is_expected.to belong_to(:user) }
it { is_expected.to belong_to(:community) }
it { is_expected.to... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/moldova_bank_account_spec.rb | spec/models/moldova_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe MoldovaBankAccount do
describe "#bank_account_type" do
it "returns MD" do
expect(create(:moldova_bank_account).bank_account_type).to eq("MD")
end
end
describe "#country" do
it "returns MD" do
expect(create(:moldova_bank_accoun... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/chile_bank_account_spec.rb | spec/models/chile_bank_account_spec.rb | # frozen_string_literal: true
describe ChileBankAccount do
describe "#bank_account_type" do
it "returns Chile" do
expect(create(:chile_bank_account).bank_account_type).to eq("CL")
end
end
describe "#country" do
it "returns CL" do
expect(create(:chile_bank_account).country).to eq("CL")
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/circle_integration_spec.rb | spec/models/circle_integration_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe CircleIntegration do
it "creates the correct json details" do
integration = create(:circle_integration)
CircleIntegration::INTEGRATION_DETAILS.each do |detail|
expect(integration.respond_to?(detail)).to eq true
end
end
it "saves det... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/trinidad_and_tobago_bank_account_spec.rb | spec/models/trinidad_and_tobago_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe TrinidadAndTobagoBankAccount do
describe "#bank_account_type" do
it "returns TT" do
expect(create(:trinidad_and_tobago_bank_account).bank_account_type).to eq("TT")
end
end
describe "#country" do
it "returns TT" do
expect(creat... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/team_invitation_spec.rb | spec/models/team_invitation_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe TeamInvitation do
let(:seller) { create(:named_seller) }
describe "validations" do
it "requires seller, email, role to be present" do
team_invitation = TeamInvitation.new
expect(team_invitation.valid?).to eq(false)
expect(team_inv... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/purchase_refund_policy_spec.rb | spec/models/purchase_refund_policy_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe PurchaseRefundPolicy do
it { is_expected.to have_one(:link).through(:purchase) }
it { is_expected.to have_one(:product_refund_policy).through(:link) }
describe "validations" do
it "validates presence" do
refund_policy = PurchaseRefundPolicy... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/community_chat_recap_run_spec.rb | spec/models/community_chat_recap_run_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe CommunityChatRecapRun do
subject(:recap_run) { build(:community_chat_recap_run) }
describe "associations" do
it { is_expected.to have_many(:community_chat_recaps).dependent(:destroy) }
end
describe "validations" do
it { is_expected.t... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/offer_code_spec.rb | spec/models/offer_code_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/max_purchase_count_concern"
describe OfferCode do
before do
@product = create(:product, user: create(:user), price_cents: 2000, price_currency_type: "usd")
end
it_behaves_like "MaxPurchaseCount concern", :offer_code
describe "c... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/user_spec.rb | spec/models/user_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/versionable_concern"
describe User, :vcr do
it_behaves_like "Versionable concern", :user, {
email: %w(old@example.com),
payment_address: %w(old-paypal@example.com paypal@example.com)
}
describe "associations" do
before :ea... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/brunei_bank_account_spec.rb | spec/models/brunei_bank_account_spec.rb | # frozen_string_literal: true
describe BruneiBankAccount do
describe "#bank_account_type" do
it "returns BN" do
expect(create(:brunei_bank_account).bank_account_type).to eq("BN")
end
end
describe "#country" do
it "returns BN" do
expect(create(:brunei_bank_account).country).to eq("BN")
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/community_spec.rb | spec/models/community_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Community do
subject(:community) { build(:community) }
describe "associations" do
it { is_expected.to belong_to(:seller).class_name("User") }
it { is_expected.to belong_to(:resource) }
it { is_expected.to have_many(:community_chat_mes... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/custom_field_spec.rb | spec/models/custom_field_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe CustomField do
describe "#as_json" do
it "returns the correct data" do
product = create(:product)
field = create(:custom_field, products: [product])
expect(field.as_json).to eq({
id: field.external... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/preorder_link_spec.rb | spec/models/preorder_link_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe PreorderLink do
describe "#release!" do
before do
@product = create(:product_with_pdf_file, price_cents: 600, is_in_preorder_state: true)
create(:rich_content, entity: @product, description: [{ "type" => "fileEmbed", "attrs" => { "id" => @... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/imported_customer_spec.rb | spec/models/imported_customer_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ImportedCustomer do
describe "validations" do
it "requires an email to create an ImportedCustomer" do
imported_customer_invalid = ImportedCustomer.new(email: nil)
expect(imported_customer_invalid).to_not be_valid
valid_customer = Imp... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/thailand_bank_account_spec.rb | spec/models/thailand_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ThailandBankAccount do
describe "#bank_account_type" do
it "returns thailand" do
expect(create(:thailand_bank_account).bank_account_type).to eq("TH")
end
end
describe "#country" do
it "returns TH" do
expect(create(:thailand_ba... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/algeria_bank_account_spec.rb | spec/models/algeria_bank_account_spec.rb | # frozen_string_literal: true
describe AlgeriaBankAccount do
describe "#bank_account_type" do
it "returns DZ" do
expect(create(:algeria_bank_account).bank_account_type).to eq("DZ")
end
end
describe "#country" do
it "returns DZ" do
expect(create(:algeria_bank_account).country).to eq("DZ")... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/turkey_bank_account_spec.rb | spec/models/turkey_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe TurkeyBankAccount do
describe "#bank_account_type" do
it "returns Turkey" do
expect(create(:turkey_bank_account).bank_account_type).to eq("TR")
end
end
describe "#country" do
it "returns TR" do
expect(create(:turkey_bank_accou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bangladesh_bank_account_spec.rb | spec/models/bangladesh_bank_account_spec.rb | # frozen_string_literal: true
describe BangladeshBankAccount do
describe "#bank_account_type" do
it "returns BD" do
expect(create(:bangladesh_bank_account).bank_account_type).to eq("BD")
end
end
describe "#country" do
it "returns BD" do
expect(create(:bangladesh_bank_account).country).to... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/macao_bank_account_spec.rb | spec/models/macao_bank_account_spec.rb | # frozen_string_literal: true
describe MacaoBankAccount do
describe "#bank_account_type" do
it "returns MO" do
expect(create(:macao_bank_account).bank_account_type).to eq("MO")
end
end
describe "#country" do
it "returns MO" do
expect(create(:macao_bank_account).country).to eq("MO")
e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/ghana_bank_account_spec.rb | spec/models/ghana_bank_account_spec.rb | # frozen_string_literal: true
describe GhanaBankAccount do
describe "#bank_account_type" do
it "returns GH" do
expect(create(:ghana_bank_account).bank_account_type).to eq("GH")
end
end
describe "#country" do
it "returns GH" do
expect(create(:ghana_bank_account).country).to eq("GH")
e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/panama_bank_account_spec.rb | spec/models/panama_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe PanamaBankAccount do
describe "#bank_account_type" do
it "returns PA" do
expect(create(:panama_bank_account).bank_account_type).to eq("PA")
end
end
describe "#country" do
it "returns PA" do
expect(create(:panama_bank_account).... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/attribute_blockable_spec.rb | spec/models/concerns/attribute_blockable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe AttributeBlockable do
let(:blocked_email) { "blocked@example.com" }
let(:unblocked_email) { "unblocked@example.com" }
let(:user_with_blocked_email) { create(:user, email: blocked_email) }
let(:user_with_unblocked_email) { create(:user, email: unbloc... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/unused_columns_spec.rb | spec/models/concerns/unused_columns_spec.rb | # frozen_string_literal: true
require "spec_helper"
ActiveRecord::Schema.define do
create_table :test_models, temporary: true, force: true do |t|
t.string :name
t.string :email
t.string :description
end
end
describe UnusedColumns do
class TestModel < ActiveRecord::Base
include UnusedColumns
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/charge_processable_spec.rb | spec/models/concerns/charge_processable_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe ChargeProcessable do
let(:test_class) do
Class.new do
include ChargeProcessable
attr_accessor :charge_processor_id
def initialize(charge_processor_id)
@charge_processor_id = charge_processor_id
end
end
end
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/rich_contents_spec.rb | spec/models/concerns/rich_contents_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe RichContents do
let(:description) { [{ "type" => "paragraph", "content" => [{ "text" => Faker::Lorem.unique.sentence, "type" => "text" }] }] }
context "for a product" do
let(:product) { create(:product) }
describe "#rich_content_json" do
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/json_data_spec.rb | spec/models/concerns/json_data_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe JsonData do
# This can be any model, but I'm using the Purchase model for the tests. I could not
# find a way to create a mock model which included JsonData.
let(:model) do
create(:purchase)
end
describe "attr_json_data_accessor" do
descr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/transactional_attribute_change_tracker_spec.rb | spec/models/concerns/transactional_attribute_change_tracker_spec.rb | # frozen_string_literal: true
describe TransactionalAttributeChangeTracker do
before do
@model = create_mock_model
@model.include(described_class)
end
after do
destroy_mock_model(@model)
end
describe "#attributes_committed" do
let!(:record) { @model.create! }
let(:fresh_record) { @model... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/stripped_fields_spec.rb | spec/models/concerns/stripped_fields_spec.rb | # frozen_string_literal: true
require "spec_helper"
ActiveRecord::Schema.define do
create_table :test_fields, temporary: true, force: true do |t|
t.string :name
t.string :email
t.string :description
t.string :sql
t.string :code
end
end
describe StrippedFields do
class TestField < Applicatio... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/with_filtering_spec.rb | spec/models/concerns/with_filtering_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe WithFiltering do
describe "scopes" do
describe "abandoned_cart_type" do
it "returns only installments with the 'abandoned_cart' type" do
abandoned_cart_installment = create(:installment, installment_type: Installment::ABANDONED_CART_TYPE... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/search_index_model_common_spec.rb | spec/models/concerns/search_index_model_common_spec.rb | # frozen_string_literal: true
describe SearchIndexModelCommon do
before do
@klass = Class.new(User)
@klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1
include SearchIndexModelCommon
include Elasticsearch::Model
index_name "user-fake-index-for-test"
mappings do
indexes :first_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/secure_external_id_spec.rb | spec/models/concerns/secure_external_id_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe SecureExternalId do
let(:test_class) do
Class.new do
include SecureExternalId
def self.name
"TestClass"
end
def self.find_by(conditions)
new if conditions[:id] == 123
end
def id
123
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/timestamp_state_fields_spec.rb | spec/models/concerns/timestamp_state_fields_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe TimestampStateFields do
class TestUser < ApplicationRecord
self.table_name = "users"
include TimestampStateFields
timestamp_state_fields \
:created,
:confirmed,
:banned,
:deleted,
default_state: :confirmed,
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/two_factor_authentication_spec.rb | spec/models/concerns/two_factor_authentication_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe TwoFactorAuthentication do
before do
@user = create(:user)
end
describe "#otp_secret_key" do
it "sets otp_secret_key for a new user" do
expect(@user.otp_secret_key.length).to eq 32
end
end
describe ".find_by_encrypted_external_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/installment/searchable_spec.rb | spec/models/concerns/installment/searchable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Installment::Searchable do
describe "#as_indexed_json" do
let(:installment) { create(:published_installment, name: "First post", message: "<p>body</p>") }
it "includes all fields" do
expect(installment.as_indexed_json).to eq(
"messa... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/product/structured_data_spec.rb | spec/models/concerns/product/structured_data_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Product::StructuredData do
let(:user) { create(:user, name: "John Doe") }
let(:product) { create(:product, user:, name: "My Great Book") }
describe "#structured_data" do
context "when product is not an ebook" do
before do
product.up... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/product/sorting_spec.rb | spec/models/concerns/product/sorting_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Product::Sorting do
let!(:seller) { create(:recommendable_user) }
describe ".sorted_by" do
let!(:collaborator) { create(:collaborator, seller:) }
let!(:product1) { create(:product, :is_collab, collaborator:, user: seller, name: "p1", display_pr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/product/staff_picked_spec.rb | spec/models/concerns/product/staff_picked_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Product::StaffPicked do
let(:product) { create(:product) }
describe "#staff_picked?" do
context "when there is no staff_picked_product record" do
it "returns false" do
expect(product.staff_picked?).to eq(false)
end
end
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/product/as_json_spec.rb | spec/models/concerns/product/as_json_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Product::AsJson, :vcr do
describe "as_json method" do
before do
@product = create(:product, name: "some link", require_shipping: true)
end
it "returns the correct has for default (public)" do
expect(@product.as_json.key?("name")).... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/payout_info_spec.rb | spec/models/concerns/user/payout_info_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::PayoutInfo do
let(:user) { create(:user, payment_address: "test@example.com", payouts_paused_internally: true) }
let(:manual_payout_end_date) { Date.today }
before do
allow(User::PayoutSchedule).to receive(:manual_payout_end_date).and_retur... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/team_spec.rb | spec/models/concerns/user/team_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::Team do
let(:user) { create(:user) }
let(:other_seller) { create(:user) }
describe "#member_of?" do
context "with self as seller" do
it "returns true" do
expect(user.member_of?(user)).to be(true)
end
end
context... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/low_balance_fraud_check_spec.rb | spec/models/concerns/user/low_balance_fraud_check_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::LowBalanceFraudCheck do
before do
@creator = create(:user)
@purchase = create(:refunded_purchase, link: create(:product, user: @creator))
end
describe "#enable_refunds!" do
before do
@creator.refunds_disabled = true
end
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/social_google_mobile_spec.rb | spec/models/concerns/user/social_google_mobile_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::SocialGoogleMobile do
let(:key_source) { instance_double(Google::Auth::IDTokens::JwkHttpKeySource) }
let(:verifier) { instance_double(Google::Auth::IDTokens::Verifier) }
let(:user) { create(:user) }
let(:payload) { { "aud" => GlobalConfig.get(... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/as_json_spec.rb | spec/models/concerns/user/as_json_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::AsJson do
describe "#as_json" do
let(:user) { create(:named_user, *user_traits) }
let(:user_traits) { [] }
let(:options) { {} }
subject(:as_json) { user.as_json(options) }
before do
create(:product, user:, custom_permalin... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/taxation_spec.rb | spec/models/concerns/user/taxation_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::Taxation do
include PaymentsHelper
before do
@user = create(:user)
end
describe "#eligible_for_1099_k?", :vcr do
let(:year) { Date.current.year }
before do
create(:merchant_account_stripe, user: @user)
create(:tos_ag... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/money_balance_spec.rb | spec/models/concerns/user/money_balance_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::MoneyBalance, :vcr do
describe "balance_formatted" do
before do
@user = create(:user, unpaid_balance_cents: 1_00)
end
it "returns the user's balance" do
expect(@user.unpaid_balance_cents).to eq 100
expect(@user.balance... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/followers_spec.rb | spec/models/concerns/user/followers_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::Followers do
describe "#following" do
let(:following_user) { create(:user, email: "follower@example.com") }
let(:not_following_user) { create(:user) }
let(:creator_one) { create(:user) }
let(:creator_two) { create(:user) }
let!(:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/social_apple_spec.rb | spec/models/concerns/user/social_apple_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::SocialApple do
let(:user) { create(:user) }
let(:id_token_double) { double(verify!: double, email_verified?: true, email: user.email) }
describe ".find_for_apple_auth" do
before do
@apple_id_client = double("apple_id_client")
al... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/affiliated_products_spec.rb | spec/models/concerns/user/affiliated_products_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::AffiliatedProducts, :vcr do
describe "#directly_affiliated_products" do
let(:affiliate_user) { create(:affiliate_user) }
let(:creator_one) { create(:named_user) }
let(:creator_two) { create(:named_user) }
let!(:product_one) { create(... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/stripe_connect_spec.rb | spec/models/concerns/user/stripe_connect_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::StripeConnect do
describe ".find_or_create_for_stripe_connect_account" do
before do
@data = {
"provider" => "stripe_connect",
"uid" => "acct_1MbJuNSAp3rt4s0F",
"info" => {
"name" => "Gum Bot",
"e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/mailer_level_spec.rb | spec/models/concerns/user/mailer_level_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::MailerLevel do
describe "#mailer_level" do
before do
@creator = create(:user)
end
context "when creator belongs to level_1" do
it "returns :level_1" do
expect(@creator.mailer_level).to eq :level_1
end
it... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/purchases_spec.rb | spec/models/concerns/user/purchases_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::Purchases do
describe "#transfer_purchases!" do
let(:user) { create(:user) }
let(:new_user) { create(:user) }
let!(:purchases) { create_list(:purchase, 3, email: user.email, purchaser: user) }
it "transfers purchases to the new user... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/user/vip_creator_spec.rb | spec/models/concerns/user/vip_creator_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe User::VipCreator do
let(:user) { create(:user) }
describe "#vip_creator?" do
context "when gross sales are above $5,000" do
it "returns true" do
create(:purchase, link: create(:product, user:, price_cents: 1_00))
create_list(:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/affiliate/sorting_spec.rb | spec/models/concerns/affiliate/sorting_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Affiliate::Sorting do
describe ".sorted_by" do
let!(:seller) { create(:named_seller) }
let!(:product1) { create(:product, user: seller, name: "p1") }
let!(:product2) { create(:product, user: seller, name: "p2") }
let!(:product3) { create(:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/affiliate/cookies_spec.rb | spec/models/concerns/affiliate/cookies_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Affiliate::Cookies do
let(:affiliate) { create(:direct_affiliate) }
let(:another_affiliate) { create(:direct_affiliate) }
describe "instance methods" do
describe "#cookie_key" do
it "generates cookie key with proper prefix and encrypted ID"... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/upsell/sorting_spec.rb | spec/models/concerns/upsell/sorting_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Upsell::Sorting do
describe ".sorted_by" do
let(:seller) { create(:named_seller) }
let(:product1) { create(:product_with_digital_versions, user: seller, price_cents: 2000, name: "Product 1") }
let(:product2) { create(:product_with_digital_vers... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/offer_code/sorting_spec.rb | spec/models/concerns/offer_code/sorting_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe OfferCode::Sorting do
describe ".sorted_by" do
let(:seller) { create(:named_seller) }
let(:product1) { create(:product, name: "Product 1", user: seller, price_cents: 1000) }
let(:product2) { create(:product, name: "Product 2", user: seller, pr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/charge/disputable_spec.rb | spec/models/concerns/charge/disputable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Charge::Disputable, :vcr do
let(:stripe_purchase) do
create(:purchase,
charge_processor_id: StripeChargeProcessor.charge_processor_id,
stripe_transaction_id: "ch_12345",
total_transaction_cents: 10_00,
succe... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/charge/chargeable_spec.rb | spec/models/concerns/charge/chargeable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Charge::Chargeable do
describe ".find_by_stripe_event" do
describe "for an event on a Purchase" do
it "finds the purchase using charge reference that is purchase's external id" do
purchase = create(:purchase, id: 12345)
event = b... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/video_file/has_thumbnail_spec.rb | spec/models/concerns/video_file/has_thumbnail_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe VideoFile::HasThumbnail do
subject(:video_file) { build(:video_file) }
let(:jpg_image) { fixture_file_upload("test.jpg") }
let(:png_image) { fixture_file_upload("test.png") }
let(:gif_image) { fixture_file_upload("test.gif") }
describe "va... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/payment/failure_reason_spec.rb | spec/models/concerns/payment/failure_reason_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Payment::FailureReason do
let(:payment) { create(:payment) }
describe "#add_payment_failure_reason_comment" do
context "when failure_reason is not present" do
it "doesn't add payout note to the user" do
expect do
payment.mar... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/order/orderable_spec.rb | spec/models/concerns/order/orderable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Order::Orderable do
describe "For Purchase" do
let(:purchase) { create(:purchase) }
describe "#require_shipping?" do
context "when the product is not physical" do
it "returns false" do
expect(purchase.require_shipping?).to... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/balance/refund_eligibility_underwriter_spec.rb | spec/models/concerns/balance/refund_eligibility_underwriter_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Balance::RefundEligibilityUnderwriter do
describe "#update_seller_refund_eligibility" do
let(:user) { create(:user) }
# Eagerly create this so `expect` block doesn't enqueue any jobs due to creating this.
let!(:balance) { create(:balance, use... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/balance/searchable_spec.rb | spec/models/concerns/balance/searchable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Balance::Searchable do
describe "#as_indexed_json" do
let(:balance) { create(:balance, amount_cents: 123, state: "unpaid") }
it "includes all fields" do
expect(balance.as_indexed_json).to eq(
"user_id" => balance.user_id,
"a... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/charge_events_handler_spec.rb | spec/models/concerns/purchase/charge_events_handler_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::ChargeEventsHandler, :vcr do
include CurrencyHelper
include ProductsHelper
describe "charge event looked up by external ID" do
let(:purchase) { create(:purchase, price_cents: 100, total_transaction_cents: 100, fee_cents: 30) }
let(:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/reportable_spec.rb | spec/models/concerns/purchase/reportable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::Reportable do
let(:product) { create(:product) }
let(:purchase) { create(:purchase, link: product) }
describe "#price_cents_net_of_refunds" do
it "returns the price" do
expect(purchase.price_cents_net_of_refunds).to eq(100)
en... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/custom_fields_spec.rb | spec/models/concerns/purchase/custom_fields_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::CustomFields do
let(:purchase) { create(:purchase) }
describe "validations" do
it "invalidates the purchase when a custom field is invalid" do
product = create(:product, custom_fields: [create(:custom_field, name: "http://test", typ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/searchable_spec.rb | spec/models/concerns/purchase/searchable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::Searchable do
before do
travel_to(Date.new(2019, 1, 1))
end
describe "#indexed_json" do
before do
@product = create(:product, name: "My Product", user: create(:named_user))
@purchase = create(:purchase,
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/receipt_spec.rb | spec/models/concerns/purchase/receipt_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::Receipt do
let(:purchase) { create(:purchase) }
describe "#receipt_email_info" do
let(:charge) { create(:charge, purchases: [purchase]) }
let(:order) { charge.order }
context "without email info records" do
it "returns nil"... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/paypal_spec.rb | spec/models/concerns/purchase/paypal_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::Paypal do
let(:charge_processor_id) { nil }
let(:card_visual) { "user@example.com" }
let(:purchase) { build(:purchase, charge_processor_id:, card_visual:) }
describe "#paypal_email" do
context "when charge_processor_id is PayPal" do
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/creator_analytics_callbacks_spec.rb | spec/models/concerns/purchase/creator_analytics_callbacks_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::CreatorAnalyticsCallbacks do
context "when the purchase happened today" do
it "does not queue job after update" do
purchase = create(:purchase_in_progress)
purchase.mark_successful!
expect(RegenerateCreatorAnalyticsCacheWo... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/purchase/blockable_spec.rb | spec/models/concerns/purchase/blockable_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase::Blockable do
let(:product) { create(:product) }
let(:buyer) { create(:user) }
let(:purchase) { create(:purchase, link: product, email: "gumbot@gumroad.com", purchaser: buyer) }
describe "#buyer_blocked?" do
it "returns false when buye... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/concerns/workflow/abandoned_cart_products_spec.rb | spec/models/concerns/workflow/abandoned_cart_products_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Workflow::AbandonedCartProducts do
include Rails.application.routes.url_helpers
describe "#abandoned_cart_products" do
let(:seller) { create(:user) }
let!(:product1) { create(:product, user: seller, name: "Product 1") }
let!(:product2) { cr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment/installment_json_spec.rb | spec/models/installment/installment_json_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe "InstallmentJson" do
before do
@creator = create(:named_user, :with_avatar)
@installment = create(:installment, call_to_action_text: "CTA", call_to_action_url: "https://www.example.com", seller: @creator)
end
describe "#installment_mobile_js... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment/installment_class_methods_spec.rb | spec/models/installment/installment_class_methods_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe "InstallmentClassMethods" do
before do
@creator = create(:named_user, :with_avatar)
@installment = create(:installment, call_to_action_text: "CTA", call_to_action_url: "https://www.example.com", seller: @creator)
end
describe ".product_or_va... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment/installment_scopes_spec.rb | spec/models/installment/installment_scopes_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe "InstallmentScopes" do
before do
@creator = create(:named_user, :with_avatar)
@installment = create(:installment, call_to_action_text: "CTA", call_to_action_url: "https://www.example.com", seller: @creator)
end
describe ".shown_on_profile" d... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment/installment_validations_spec.rb | spec/models/installment/installment_validations_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe "InstallmentValidations" do
describe "#validate_sending_limit_for_sellers" do
before do
stub_const("Installment::SENDING_LIMIT", 2)
@seller = create(:user)
@installment = build(:installment, seller: @seller)
end
context "whe... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment/installment_filters_spec.rb | spec/models/installment/installment_filters_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/with_filtering_support"
describe "InstallmentFilters" do
before do
@creator = create(:named_user, :with_avatar)
@installment = create(:installment, call_to_action_text: "CTA", call_to_action_url: "https://www.example.com", seller:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment/installment_send_installment_spec.rb | spec/models/installment/installment_send_installment_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe "InstallmentSendInstallment" do
before do
@creator = create(:named_user, :with_avatar)
@installment = create(:installment, call_to_action_text: "CTA", call_to_action_url: "https://www.example.com", seller: @creator)
end
describe "publish" do... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.