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/media_location_spec.rb | spec/models/media_location_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe MediaLocation do
describe "#create" do
before do
@url_redirect = create(:readable_url_redirect)
@product = @url_redirect.referenced_link
end
it "raises error if platform is invalid" do
media_location = build(:media_location,... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/taxonomy_spec.rb | spec/models/taxonomy_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Taxonomy do
describe "validations" do
describe "slug presence validation" do
context "when slug is present" do
subject { build(:taxonomy, slug: "example") }
it { is_expected.to be_valid }
end
context "when slug is n... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/community_chat_recap_spec.rb | spec/models/community_chat_recap_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe CommunityChatRecap do
subject(:chat_recap) { build(:community_chat_recap) }
describe "associations" do
it { is_expected.to belong_to(:community_chat_recap_run) }
it { is_expected.to belong_to(:community).optional }
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/bundle_product_purchase_spec.rb | spec/models/bundle_product_purchase_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe BundleProductPurchase do
describe "validations" do
let(:bundle_product_purchase) { create(:bundle_product_purchase) }
context "bundle product purchase is valid" do
it "doesn't add an error" do
expect(bundle_product_purchase).to be_v... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/audience_member_spec.rb | spec/models/audience_member_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe AudienceMember, :freeze_time do
describe "validations" do
it "validates json schema" do
member = build(:audience_member, details: { "foo" => "bar" })
expect(member).to be_invalid
expect(member.errors[:details]).to be_present
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/price_spec.rb | spec/models/price_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Price do
it "belongs to a link" do
price = create(:price)
expect(price.link).to be_a Link
end
it "validates presence of the link" do
invalid_price = create(:price)
invalid_price.link = nil
expect(invalid_price).not_to be_valid
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/global_affiliate_spec.rb | spec/models/global_affiliate_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe GlobalAffiliate do
describe "validations" do
describe "affiliate_basis_points" do
it "requires affiliate_basis_points to be present" do
affiliate = create(:user).global_affiliate # sets affiliate basis points in pre-validation hook on cr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/egypt_bank_account_spec.rb | spec/models/egypt_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe KenyaBankAccount do
describe "#bank_account_type" do
it "returns EG" do
expect(create(:egypt_bank_account).bank_account_type).to eq("EG")
end
end
describe "#country" do
it "returns EG" do
expect(create(:egypt_bank_account).cou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/niger_bank_account_spec.rb | spec/models/niger_bank_account_spec.rb | # frozen_string_literal: true
describe NigerBankAccount do
describe "#bank_account_type" do
it "returns NE" do
expect(create(:niger_bank_account).bank_account_type).to eq("NE")
end
end
describe "#country" do
it "returns NE" do
expect(create(:niger_bank_account).country).to eq("NE")
e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/hungary_bank_account_spec.rb | spec/models/hungary_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe HungaryBankAccount do
describe "#bank_account_type" do
it "returns hungary" do
expect(create(:hungary_bank_account).bank_account_type).to eq("HU")
end
end
describe "#country" do
it "returns HU" do
expect(create(:hungary_bank_a... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/self_service_affiliate_product_spec.rb | spec/models/self_service_affiliate_product_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SelfServiceAffiliateProduct do
let(:creator) { create(:user) }
describe "validations" do
let(:product) { create(:product, user: creator) }
subject(:self_service_affiliate_product) { build(:self_service_affiliate_product, product:, seller: creat... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/seller_profile_wishlists_section_spec.rb | spec/models/seller_profile_wishlists_section_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SellerProfileWishlistsSection do
describe "validations" do
it "validates json_data with the correct schema" do
section = build(:seller_profile_wishlists_section, shown_wishlists: [create(:wishlist).id])
section.json_data["garbage"] = "shou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sri_lanka_bank_account_spec.rb | spec/models/sri_lanka_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SriLankaBankAccount do
describe "#bank_account_type" do
it "returns LK" do
expect(create(:sri_lanka_bank_account).bank_account_type).to eq("LK")
end
end
describe "#country" do
it "returns LK" do
expect(create(:sri_lanka_bank_a... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/nigeria_bank_account_spec.rb | spec/models/nigeria_bank_account_spec.rb | # frozen_string_literal: true
describe NigeriaBankAccount do
describe "#bank_account_type" do
it "returns NG" do
expect(create(:nigeria_bank_account).bank_account_type).to eq("NG")
end
end
describe "#country" do
it "returns NG" do
expect(create(:nigeria_bank_account).country).to eq("NG")... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sales_export_spec.rb | spec/models/sales_export_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe SalesExport do
describe "#destroy" do
it "deletes chunks" do
export = create(:sales_export)
create(:sales_export_chunk, export:)
expect(SalesExportChunk.count).to eq(1)
export.destroy!
expect(SalesExportChunk.count)... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sent_post_email_spec.rb | spec/models/sent_post_email_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SentPostEmail do
let(:post) { create(:post) }
describe "creation" do
it "downcases email" do
record = create(:sent_post_email, email: "FOO")
expect(record.reload.email).to eq("foo")
end
it "ensures emails are unique for each po... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bahrain_bank_account_spec.rb | spec/models/bahrain_bank_account_spec.rb | # frozen_string_literal: true
describe BahrainBankAccount do
describe "#bank_account_type" do
it "returns BH" do
expect(create(:bahrain_bank_account).bank_account_type).to eq("BH")
end
end
describe "#country" do
it "returns BH" do
expect(create(:bahrain_bank_account).country).to eq("BH")... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/purchase_custom_field_spec.rb | spec/models/purchase_custom_field_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe PurchaseCustomField do
describe "validations" do
it "validates field type is a custom field type" do
purchase_custom_field = described_class.new(field_type: "invalid")
expect(purchase_custom_field).not_to be_valid
expect(purchase_cus... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/upsell_purchase_spec.rb | spec/models/upsell_purchase_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe UpsellPurchase do
describe "validations" do
context "when the upsell doesn't belong to the purchase's product" do
let(:upsell_purchase) { build(:upsell_purchase, selected_product: create(:product), purchase: create(:purchase, link: create(:produ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/denmark_bank_account_spec.rb | spec/models/denmark_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe DenmarkBankAccount do
describe "#bank_account_type" do
it "returns denmark" do
expect(create(:denmark_bank_account).bank_account_type).to eq("DK")
end
end
describe "#country" do
it "returns DK" do
expect(create(:denmark_bank_a... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/laos_bank_account_spec.rb | spec/models/laos_bank_account_spec.rb | # frozen_string_literal: true
describe LaosBankAccount do
describe "#bank_account_type" do
it "returns LA" do
expect(create(:laos_bank_account).bank_account_type).to eq("LA")
end
end
describe "#country" do
it "returns LA" do
expect(create(:laos_bank_account).country).to eq("LA")
end
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/poland_bank_account_spec.rb | spec/models/poland_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe PolandBankAccount do
describe "#bank_account_type" do
it "returns poland" do
expect(create(:poland_bank_account).bank_account_type).to eq("PL")
end
end
describe "#country" do
it "returns PL" do
expect(create(:poland_bank_accou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/direct_affiliate_spec.rb | spec/models/direct_affiliate_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe DirectAffiliate do
let(:product) { create(:product, price_cents: 10_00, unique_permalink: "p") }
let(:seller) { product.user }
let(:affiliate_user) { create(:affiliate_user) }
let(:direct_affiliate) { create(:direct_affiliate, affiliate_user:, selle... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/rich_content_spec.rb | spec/models/rich_content_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe RichContent do
describe "validations" do
describe "description" do
context "invalid descriptions" do
let(:invalid_descriptions) { ["not valid", ["also not valid"], [{ "type" => 2 }]] }
it "adds error when the description is inva... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/jamaica_bank_account_spec.rb | spec/models/jamaica_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe JamaicaBankAccount do
describe "#bank_account_type" do
it "returns JM" do
expect(create(:jamaica_bank_account).bank_account_type).to eq("JM")
end
end
describe "#country" do
it "returns JM" do
expect(create(:jamaica_bank_accoun... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/email_info_charge.rb | spec/models/email_info_charge.rb | # frozen_string_literal: true
require "spec_helper"
describe EmailInfoCharge do
describe "validations" do
it "requires charge_id and email_info_id" do
email_info_charge = EmailInfoCharge.new
expect(email_info_charge).to_not be_valid
expect(email_info_charge.errors.full_messages).to include("Ch... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/guatemala_bank_account_spec.rb | spec/models/guatemala_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe GuatemalaBankAccount do
describe "#bank_account_type" do
it "returns GT" do
expect(create(:guatemala_bank_account).bank_account_type).to eq("GT")
end
end
describe "#country" do
it "returns GT" do
expect(create(:guatemala_bank_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/australian_bank_account_spec.rb | spec/models/australian_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe AustralianBankAccount do
describe "bsb_number" do
describe "is 6 digits" do
let(:australian_bank_account) { build(:australian_bank_account, bsb_number: "062111") }
it "is valid" do
expect(australian_bank_account).to be_valid
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/singaporean_bank_account_spec.rb | spec/models/singaporean_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SingaporeanBankAccount do
describe "#bank_account_type" do
it "returns singapore" do
expect(create(:singaporean_bank_account).bank_account_type).to eq("SG")
end
end
describe "#country" do
it "returns SG" do
expect(create(:sing... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/saudi_arabia_bank_account_spec.rb | spec/models/saudi_arabia_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SaudiArabiaBankAccount do
describe "#bank_account_type" do
it "returns SA" do
expect(create(:saudi_arabia_bank_account).bank_account_type).to eq("SA")
end
end
describe "#country" do
it "returns SA" do
expect(create(:saudi_arab... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment_plan_snapshot_spec.rb | spec/models/installment_plan_snapshot_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe InstallmentPlanSnapshot do
let(:subscription) { create(:subscription) }
let(:payment_option) { create(:payment_option, subscription: subscription) }
describe "associations" do
it "belongs to payment_option" do
snapshot = build(:installment_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/consumption_event_spec.rb | spec/models/consumption_event_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ConsumptionEvent do
describe ".create_event!" do
let(:url_redirect) { create(:url_redirect) }
let(:purchase) { url_redirect.purchase }
let(:product) { purchase.link }
let(:product_file) { create(:product_file) }
let(:product_folder) { ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/wishlist_spec.rb | spec/models/wishlist_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Wishlist do
describe "#find_by_url_slug" do
let(:wishlist) { create(:wishlist) }
it "finds a wishlist" do
expect(Wishlist.find_by_url_slug(wishlist.url_slug)).to eq(wishlist)
end
it "returns nil when the wishlist does not exist" do... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/charge_purchase_spec.rb | spec/models/charge_purchase_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ChargePurchase do
describe "validations" do
it "validates presence of required attributes" do
charge_purchase = described_class.new
expect(charge_purchase).to be_invalid
expect(charge_purchase.errors.messages).to eq(charge: ["must e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/wishlist_follower_spec.rb | spec/models/wishlist_follower_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe WishlistFollower do
describe "validations" do
it "validates uniqueness of follower" do
wishlist = create(:wishlist)
user = create(:buyer_user)
first_follower = create(:wishlist_follower, wishlist:, follower_user: user)
second_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/morocco_bank_account_spec.rb | spec/models/morocco_bank_account_spec.rb | # frozen_string_literal: true
describe MoroccoBankAccount do
describe "#bank_account_type" do
it "returns Morocco" do
expect(create(:morocco_bank_account).bank_account_type).to eq("MA")
end
end
describe "#country" do
it "returns MA" do
expect(create(:morocco_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/shipment_spec.rb | spec/models/shipment_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Shipment do
describe "#shipped?" do
it "returns false is shipped_at is nil" do
expect(create(:shipment).shipped?).to be(false)
end
it "returns true is shipped_at is present" do
expect(create(:shipment, shipped_at: 1.day.ago).shipp... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/cached_sales_related_products_info_spec.rb | spec/models/cached_sales_related_products_info_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe CachedSalesRelatedProductsInfo do
describe "validations" do
it "validates counts column format" do
record = build(:cached_sales_related_products_info, counts: { "123" => "bar" })
expect(record).to be_invalid
expect(record.errors[:cou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/collaborator_invitation_spec.rb | spec/models/collaborator_invitation_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe CollaboratorInvitation, type: :model do
describe "#accept!" do
it "destroys the invitation" do
invitation = create(:collaborator_invitation)
expect { invitation.accept! }.to change(CollaboratorInvitation, :count).by(-1)
expect... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/guyana_bank_account_spec.rb | spec/models/guyana_bank_account_spec.rb | # frozen_string_literal: true
describe GuyanaBankAccount do
describe "#bank_account_type" do
it "returns GY" do
expect(create(:guyana_bank_account).bank_account_type).to eq("GY")
end
end
describe "#country" do
it "returns GY" do
expect(create(:guyana_bank_account).country).to eq("GY")
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/seller_profile_posts_section_spec.rb | spec/models/seller_profile_posts_section_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SellerProfilePostsSection do
describe "validations" do
it "validates json_data with the correct schema" do
section = build(:seller_profile_posts_section, shown_posts: [1])
section.json_data["garbage"] = "should not be here"
schema = ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_folder_spec.rb | spec/models/product_folder_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ProductFolder do
it "validates presence of attributes" do
product_folder = build(:product_folder, name: "")
expect(product_folder.valid?).to eq(false)
expect(product_folder.errors.messages).to eq(
name: ["can't be blank"]
)
end
en... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sweden_bank_account_spec.rb | spec/models/sweden_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SwedenBankAccount do
describe "#bank_account_type" do
it "returns sweden" do
expect(create(:sweden_bank_account).bank_account_type).to eq("SE")
end
end
describe "#country" do
it "returns SE" do
expect(create(:sweden_bank_accou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/variant_spec.rb | spec/models/variant_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/max_purchase_count_concern"
describe Variant do
it_behaves_like "MaxPurchaseCount concern", :variant
describe "lifecycle hooks" do
describe "before_validation :strip_subscription_price_change_message" do
it "ensures text is pr... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/call_spec.rb | spec/models/call_spec.rb | # frozen_string_literal: true
require "sidekiq/testing"
describe Call do
let(:link) { create(:call_product, :available_for_a_year) }
let(:call_limitation_info) { link.call_limitation_info }
describe "normalizations", :freeze_time do
before { travel_to(DateTime.parse("May 1 2024 UTC")) }
it "drops sub-... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/saint_lucia_bank_account_spec.rb | spec/models/saint_lucia_bank_account_spec.rb | # frozen_string_literal: true
describe SaintLuciaBankAccount do
describe "#bank_account_type" do
it "returns LC" do
expect(create(:saint_lucia_bank_account).bank_account_type).to eq("LC")
end
end
describe "#country" do
it "returns LC" do
expect(create(:saint_lucia_bank_account).country).... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_integration_spec.rb | spec/models/product_integration_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ProductIntegration do
describe "validations" do
before do
@integration = create(:circle_integration)
@product = create(:product)
end
it "raises error if product_id is not present" do
product_integration = ProductIntegration.... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/zoom_integration_spec.rb | spec/models/zoom_integration_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ZoomIntegration do
it "creates the correct json details" do
integration = create(:zoom_integration)
ZoomIntegration::INTEGRATION_DETAILS.each do |detail|
expect(integration.respond_to?(detail)).to eq true
end
end
it "saves details c... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/large_seller_spec.rb | spec/models/large_seller_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe LargeSeller do
before do
@user = create(:user)
end
describe ".create_if_warranted" do
it "doesn't create a record if large seller already exists" do
create(:large_seller, user: @user)
expect do
described_class.create_if_wa... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/mongolia_bank_account_spec.rb | spec/models/mongolia_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe MongoliaBankAccount do
describe "#bank_account_type" do
it "returns MN" do
expect(create(:mongolia_bank_account).bank_account_type).to eq("MN")
end
end
describe "#country" do
it "returns MN" do
expect(create(:mongolia_bank_acc... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sent_email_info_spec.rb | spec/models/sent_email_info_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SentEmailInfo do
describe "validations" do
it "doesn't allow empty keys" do
expect do
SentEmailInfo.set_key!(nil)
end.to raise_error(ActiveRecord::RecordInvalid)
end
it "doesn't allow duplicate keys" do
SentEmailInfo... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/tanzania_bank_account_spec.rb | spec/models/tanzania_bank_account_spec.rb | # frozen_string_literal: true
describe TanzaniaBankAccount do
describe "#bank_account_type" do
it "returns TZ" do
expect(create(:tanzania_bank_account).bank_account_type).to eq("TZ")
end
end
describe "#country" do
it "returns TZ" do
expect(create(:tanzania_bank_account).country).to eq("T... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/seller_profile_products_section_spec.rb | spec/models/seller_profile_products_section_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SellerProfileProductsSection do
describe "validations" do
it "validates json_data with the correct schema" do
section = build(:seller_profile_products_section, shown_products: [create(:product, name: "Product 1").id])
section.json_data["ga... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/commission_spec.rb | spec/models/commission_spec.rb | # frozen_string_literal: true
describe Commission, :vcr do
describe "validations" do
it "validates inclusion of status in STATUSES" do
commission = build(:commission, status: "invalid_status")
expect(commission).to be_invalid
expect(commission.errors.full_messages).to include("Status is not inc... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_review_stat_spec.rb | spec/models/product_review_stat_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ProductReviewStat do
describe "#rating_counts" do
it "returns counts of ratings" do
review_stat = build(:product_review_stat, ratings_of_one_count: 7, ratings_of_three_count: 11)
expect(review_stat.rating_counts).to eq(1 => 7, 2 => 0, 3 =>... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/link_spec.rb | spec/models/link_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/max_purchase_count_concern"
describe Link, :vcr do
include PreorderHelper
let(:link) { create(:product) }
subject { link }
before do
@mock_obj = Object.new
allow(@mock_obj).to receive(:code).and_return(200)
allow(HTTPar... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment_event_spec.rb | spec/models/installment_event_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe InstallmentEvent do
context "Creation" do
it "queues update of Installment's installment_events_count" do
installment_event = create(:installment_event)
expect(UpdateInstallmentEventsCountCacheWorker).to have_enqueued_sidekiq_job(installme... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/uruguay_bank_account_spec.rb | spec/models/uruguay_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe UruguayBankAccount do
describe "#bank_account_type" do
it "returns UY" do
expect(create(:uruguay_bank_account).bank_account_type).to eq("UY")
end
end
describe "#country" do
it "returns UY" do
expect(create(:uruguay_bank_accoun... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/cambodia_bank_account_spec.rb | spec/models/cambodia_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe CambodiaBankAccount do
describe "#bank_account_type" do
it "returns KH" do
expect(create(:cambodia_bank_account).bank_account_type).to eq("KH")
end
end
describe "#country" do
it "returns KH" do
expect(create(:cambodia_bank_acc... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/refund_spec.rb | spec/models/refund_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Refund do
it "validates that processor_refund_id is unique" do
create(:refund, processor_refund_id: "ref_id")
new_ref = build(:refund, processor_refund_id: "ref_id")
expect(new_ref.valid?).to_not be(true)
end
describe "flags" do
it "... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/follower_spec.rb | spec/models/follower_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/deletable_concern"
RSpec.describe Follower do
it_behaves_like "Deletable concern", :follower
let(:active_follower) { create(:active_follower) }
let(:deleted_follower) { create(:deleted_follower) }
let(:unconfirmed_follower) { create... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/seller_profile_rich_text_section_spec.rb | spec/models/seller_profile_rich_text_section_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SellerProfileRichTextSection do
describe "validations" do
it "validates json_data with the correct schema" do
section = build(:seller_profile_rich_text_section)
section.json_data["garbage"] = "should not be here"
schema = JSON.parse(... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bosnia_and_herzegovina_bank_account_spec.rb | spec/models/bosnia_and_herzegovina_bank_account_spec.rb | # frozen_string_literal: true
describe BosniaAndHerzegovinaBankAccount do
describe "#bank_account_type" do
it "returns BA" do
expect(create(:bosnia_and_herzegovina_bank_account).bank_account_type).to eq("BA")
end
end
describe "#country" do
it "returns BA" do
expect(create(:bosnia_and_her... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/affiliate_request_spec.rb | spec/models/affiliate_request_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe AffiliateRequest do
describe "validations" do
subject(:affiliate_request) { build(:affiliate_request) }
it "validates without any error" do
expect(affiliate_request).to be_valid
end
describe "presence" do
subject(:affiliate_r... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/philippines_bank_account_spec.rb | spec/models/philippines_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe PhilippinesBankAccount do
describe "#bank_account_type" do
it "returns philippines" do
expect(create(:philippines_bank_account).bank_account_type).to eq("PH")
end
end
describe "#country" do
it "returns PH" do
expect(create(:ph... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/tag_spec.rb | spec/models/tag_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Tag do
before { @product = create(:product) }
it "Creates a new tag by name" do
expect(@product.has_tag?("bAdger")).to be(false)
expect { @product.tag!("Badger") }.to change { @product.tags.count }.by(1)
expect(@product.tags.last.name).to e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/shipping_destination_spec.rb | spec/models/shipping_destination_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ShippingDestination do
before :each do
@product = create(:product)
end
it "it does not allow saving if the country code is nil or invalid" do
@product.shipping_destinations << ShippingDestination.new(country_code: "dummy",
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/seller_profile_featured_product_section_spec.rb | spec/models/seller_profile_featured_product_section_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SellerProfileFeaturedProductSection do
describe "validations" do
it "validates json_data with the correct schema" do
section = build(:seller_profile_featured_product_section, featured_product_id: 1)
section.json_data["garbage"] = "should n... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/post_email_blast_spec.rb | spec/models/post_email_blast_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe PostEmailBlast do
let(:blast) { create(:post_email_blast) }
describe ".aggregated", :freeze_time do
before do
create(:post_email_blast, requested_at: Time.current, started_at: nil, first_email_delivered_at: nil, last_email_delivered_at:... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/collaborator_spec.rb | spec/models/collaborator_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Collaborator do
describe "associations" do
it { is_expected.to belong_to(:seller) }
end
describe "validations" do
it { is_expected.to validate_numericality_of(:affiliate_basis_points).is_greater_than_or_equal_to(1_00).is_less_than_or_equal_to... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/gibraltar_bank_account_spec.rb | spec/models/gibraltar_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe GibraltarBankAccount do
describe "#bank_account_type" do
it "returns gibraltar" do
expect(create(:gibraltar_bank_account).bank_account_type).to eq("GI")
end
end
describe "#country" do
it "returns GI" do
expect(create(:gibralta... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_tagging_spec.rb | spec/models/product_tagging_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ProductTagging do
before do
@creator = create(:user)
product_a = create(:product)
product_a.tag!("tag a")
product_a.tag!("tag b")
product_a.tag!("tag c")
product_b = create(:product, user: @creator)
product_b.tag!("tag b")
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_review_video_spec.rb | spec/models/product_review_video_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe ProductReviewVideo, type: :model do
describe "approval status transitions" do
let(:product_review) { create(:product_review) }
let!(:pending_video) { create(:product_review_video, :pending_review, product_review:) }
let!(:approved_video)... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bulgaria_bank_account_spec.rb | spec/models/bulgaria_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe BulgariaBankAccount do
describe "#bank_account_type" do
it "returns bulgaria" do
expect(create(:bulgaria_bank_account).bank_account_type).to eq("BG")
end
end
describe "#country" do
it "returns BG" do
expect(create(:bulgaria_ba... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/botswana_bank_account_spec.rb | spec/models/botswana_bank_account_spec.rb | # frozen_string_literal: true
describe BotswanaBankAccount do
describe "#bank_account_type" do
it "returns BW" do
expect(create(:botswana_bank_account).bank_account_type).to eq("BW")
end
end
describe "#country" do
it "returns BW" do
expect(create(:botswana_bank_account).country).to eq("B... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/backtax_agreement_spec.rb | spec/models/backtax_agreement_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe BacktaxAgreement do
describe "validation" do
it "is valid with expected parameters" do
expect(build(:backtax_agreement)).to be_valid
end
it "validates the presence of a signature" do
expect(build(:backtax_agreement, signature: nil... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/purchase_spec.rb | spec/models/purchase_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Purchase, :vcr do
include CurrencyHelper
include ProductsHelper
def verify_balance(user, expected_balance)
expect(user.unpaid_balance_cents).to eq expected_balance
end
let(:ip_address) { "24.7.90.214" }
let(:initial_balance) { 200 }
let(... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/ethiopia_bank_account_spec.rb | spec/models/ethiopia_bank_account_spec.rb | # frozen_string_literal: true
describe EthiopiaBankAccount do
describe "#bank_account_type" do
it "returns ET" do
expect(create(:ethiopia_bank_account).bank_account_type).to eq("ET")
end
end
describe "#country" do
it "returns ET" do
expect(create(:ethiopia_bank_account).country).to eq("E... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/customer_email_info_spec.rb | spec/models/customer_email_info_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe CustomerEmailInfo do
describe ".find_or_initialize_for_charge" do
let(:purchase) { create(:purchase) }
let(:charge) { create(:charge, purchases: [purchase]) }
context "when the record doesn't exist" do
it "initializes a new record" do
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sales_related_products_info_spec.rb | spec/models/sales_related_products_info_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SalesRelatedProductsInfo do
describe ".find_or_create_info" do
let(:sales_related_products_info) { create(:sales_related_products_info) }
context "when the info exists" do
it "returns the info" do
expect(described_class.find_or_crea... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/gabon_bank_account_spec.rb | spec/models/gabon_bank_account_spec.rb | # frozen_string_literal: true
describe GabonBankAccount do
describe "#bank_account_type" do
it "returns GA" do
expect(create(:gabon_bank_account).bank_account_type).to eq("GA")
end
end
describe "#country" do
it "returns GA" do
expect(create(:gabon_bank_account).country).to eq("GA")
e... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/event_spec.rb | spec/models/event_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Event do
describe "post view" do
before do
link = create(:product, name: "product name")
@post = create(:installment, link:)
@post_view_event = create(:post_view_event)
@installment_event = create(:installment_event, event_id: ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bhutan_bank_account_spec.rb | spec/models/bhutan_bank_account_spec.rb | # frozen_string_literal: true
describe BhutanBankAccount do
describe "#bank_account_type" do
it "returns BT" do
expect(create(:bhutan_bank_account).bank_account_type).to eq("BT")
end
end
describe "#country" do
it "returns BT" do
expect(create(:bhutan_bank_account).country).to eq("BT")
... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/mailer_info_spec.rb | spec/models/mailer_info_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe MailerInfo do
describe ".header_name" do
it "formats valid header names" do
expect(described_class.header_name(:email_provider)).to eq("X-GUM-Email-Provider")
expect(described_class.header_name(:mailer_class)).to eq("X-GUM-Mailer-Cla... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_cached_value_spec.rb | spec/models/product_cached_value_spec.rb | # frozen_string_literal: true
describe ProductCachedValue do
describe "#create" do
it "is valid with a product" do
expect(build(:product_cached_value, product: create(:product))).to be_valid
end
it "is invalid without a product" do
expect(build(:product_cached_value, product: nil)).to_not be... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/senegal_bank_account_spec.rb | spec/models/senegal_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SenegalBankAccount do
describe "#bank_account_type" do
it "returns senegal" do
expect(create(:senegal_bank_account).bank_account_type).to eq("SN")
end
end
describe "#country" do
it "returns SN" do
expect(create(:senegal_bank_a... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/wishlist_product_spec.rb | spec/models/wishlist_product_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe WishlistProduct do
describe "validations" do
let(:wishlist) { create(:wishlist) }
let(:product) { create(:product) }
let(:wishlist_product) { described_class.new(wishlist:, product:) }
it "validates the product is unique in the wishlist" ... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/iceland_bank_account_spec.rb | spec/models/iceland_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe IcelandBankAccount do
describe "#bank_account_type" do
it "returns IS" do
expect(create(:iceland_bank_account).bank_account_type).to eq("IS")
end
end
describe "#country" do
it "returns IS" do
expect(create(:iceland_bank_accoun... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/blocked_object_spec.rb | spec/models/blocked_object_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe BlockedObject do
describe ".block!" do
describe "when blocked object doesn't exist" do
it "creates a new blocked object record" do
count = BlockedObject.count
BlockedObject.block!(BLOCKED_OBJECT_TYPES[:ip_address], "123.456.789.0... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/vietnam_bank_account_spec.rb | spec/models/vietnam_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe VietnamBankAccount do
describe "#bank_account_type" do
it "returns Vietnam" do
expect(create(:vietnam_bank_account).bank_account_type).to eq("VN")
end
end
describe "#country" do
it "returns VN" do
expect(create(:vietnam_bank_a... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/kenya_bank_account_spec.rb | spec/models/kenya_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe KenyaBankAccount do
describe "#bank_account_type" do
it "returns KE" do
expect(create(:kenya_bank_account).bank_account_type).to eq("KE")
end
end
describe "#country" do
it "returns KE" do
expect(create(:kenya_bank_account).cou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/el_salvador_bank_account_spec.rb | spec/models/el_salvador_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe ElSalvadorBankAccount do
describe "#bank_account_type" do
it "returns SV" do
expect(create(:el_salvador_bank_account).bank_account_type).to eq("SV")
end
end
describe "#country" do
it "returns SV" do
expect(create(:el_salvador_... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/madagascar_bank_account_spec.rb | spec/models/madagascar_bank_account_spec.rb | # frozen_string_literal: true
describe MadagascarBankAccount do
describe "#bank_account_type" do
it "returns Madagascar" do
expect(create(:madagascar_bank_account).bank_account_type).to eq("MG")
end
end
describe "#country" do
it "returns MG" do
expect(create(:madagascar_bank_account).cou... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/swiss_bank_account_spec.rb | spec/models/swiss_bank_account_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SwissBankAccount do
describe "#bank_account_type" do
it "returns swiss" do
expect(create(:swiss_bank_account).bank_account_type).to eq("CH")
end
end
describe "#country" do
it "returns CH" do
expect(create(:swiss_bank_account).... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/computed_sales_analytics_day_spec.rb | spec/models/computed_sales_analytics_day_spec.rb | # frozen_string_literal: true
require "spec_helper"
RSpec.describe ComputedSalesAnalyticsDay do
describe ".read_data_from_keys" do
it "returns hash with sorted existing keys and parsed values" do
create(:computed_sales_analytics_day, key: "k2", data: { v: 2 }.to_json)
create(:computed_sales_analytic... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/payment_spec.rb | spec/models/payment_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Payment do
describe "mark" do
it "sets the appropriate state" do
payment = create(:payment)
payment.mark("failed")
expect(payment.reload.state).to eq "failed"
payment = create(:payment)
payment.mark("cancelled")
ex... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/staff_picked_product_spec.rb | spec/models/staff_picked_product_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe RefundPolicy do
describe "validations" do
it "validates presence" do
staff_picked_product = StaffPickedProduct.new
expect(staff_picked_product.valid?).to be false
expect(staff_picked_product.errors.details[:product].first[:error]).t... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment_spec.rb | spec/models/installment_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Installment do
include Rails.application.routes.url_helpers
before do
@creator = create(:named_user, :with_avatar)
@installment = @post = create(:installment, call_to_action_text: "CTA", call_to_action_url: "https://www.example.com", seller: @c... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | true |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/serbia_bank_account_spec.rb | spec/models/serbia_bank_account_spec.rb | # frozen_string_literal: true
describe SerbiaBankAccount do
describe "#bank_account_type" do
it "returns Serbia" do
expect(create(:serbia_bank_account).bank_account_type).to eq("RS")
end
end
describe "#country" do
it "returns RS" do
expect(create(:serbia_bank_account).country).to eq("RS"... | ruby | MIT | 638f6c3a40b23b907c09f6881d4df18339da069c | 2026-01-04T15:39:11.815677Z | false |
antiwork/gumroad | https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/seller_profile_spec.rb | spec/models/seller_profile_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe SellerProfile do
describe "#custom_styles" do
subject { create(:seller_profile, highlight_color: "#009a49", font: "Roboto Mono", background_color: "#000000") }
it "has CSS for background color, accent color, and font" do
expect(subject.cust... | 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.