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/country_spec.rb
spec/models/country_spec.rb
# frozen_string_literal: true describe Country do describe "#supports_stripe_cross_border_payouts?" do it "returns true if country only supports cross-border payouts via stripe otherwise returns false" do expect(Country.new("US").supports_stripe_cross_border_payouts?).to be false expect(Country.new("...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
true
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/invite_spec.rb
spec/models/invite_spec.rb
# frozen_string_literal: true require "spec_helper" describe Invite do describe "scopes" do before do @invite_sent = create(:invite) @invite_signed_up = create(:invite, invite_state: "signed_up") end describe "#invitation_sent" do it "returns only the records with sta...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/kazakhstan_bank_account_spec.rb
spec/models/kazakhstan_bank_account_spec.rb
# frozen_string_literal: true describe KazakhstanBankAccount do describe "#bank_account_type" do it "returns KZ" do expect(create(:kazakhstan_bank_account).bank_account_type).to eq("KZ") end end describe "#country" do it "returns KZ" do expect(create(:kazakhstan_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/zip_tax_rate_spec.rb
spec/models/zip_tax_rate_spec.rb
# frozen_string_literal: true require "spec_helper" describe ZipTaxRate do it "requires a combined rate" do ztr = ZipTaxRate.new(zip_code: "90210", country: "US", state: "CA", is_seller_responsible: true) expect(ztr).to_not be_valid end describe "flags" do it "has `is_seller_responsible` flag" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/signup_event_spec.rb
spec/models/signup_event_spec.rb
# frozen_string_literal: true require "spec_helper" describe SignupEvent do it "is an Event" do expect(build(:signup_event).is_a?(Event)).to eq(true) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bundle_product_spec.rb
spec/models/bundle_product_spec.rb
# frozen_string_literal: true require "spec_helper" describe BundleProduct do describe "#standalone_price_cents" do let(:bundle_product) { create(:bundle_product, quantity: 2) } it "returns the correct price" do expect(bundle_product.standalone_price_cents).to eq(200) end context "when the p...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bahamas_bank_account_spec.rb
spec/models/bahamas_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe BahamasBankAccount do describe "#bank_account_type" do it "returns BS" do expect(create(:bahamas_bank_account).bank_account_type).to eq("BS") end end describe "#country" do it "returns BS" do expect(create(:bahamas_bank_accoun...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/utm_link_driven_sale_spec.rb
spec/models/utm_link_driven_sale_spec.rb
# frozen_string_literal: true require "spec_helper" describe UtmLinkDrivenSale do describe "associations" do it { is_expected.to belong_to(:utm_link).optional(false) } it { is_expected.to belong_to(:utm_link_visit).optional(false) } it { is_expected.to belong_to(:purchase).optional(false) } end des...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/user_compliance_info_request_spec.rb
spec/models/user_compliance_info_request_spec.rb
# frozen_string_literal: true require "spec_helper" describe UserComplianceInfoRequest do describe "only_needs_field_to_be_partially_provided" do let(:request_1) { create(:user_compliance_info_request, only_needs_field_to_be_partially_provided: true) } let(:request_2) { create(:user_compliance_info_request,...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/upsell_variant_spec.rb
spec/models/upsell_variant_spec.rb
# frozen_string_literal: true require "spec_helper" describe UpsellVariant do describe "validations" do context "when the variants don't belong to the upsell's offered product" do before do @upsell_variant = build(:upsell_variant, selected_variant: create(:variant), offered_variant: create(:varian...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/azerbaijan_bank_account_spec.rb
spec/models/azerbaijan_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe AzerbaijanBankAccount do describe "#bank_account_type" do it "returns AZ" do expect(create(:azerbaijan_bank_account).bank_account_type).to eq("AZ") end end describe "#country" do it "returns AZ" do expect(create(:azerbaijan_ba...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/kuwait_bank_account_spec.rb
spec/models/kuwait_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe KuwaitBankAccount do describe "#bank_account_type" do it "returns KW" do expect(create(:kuwait_bank_account).bank_account_type).to eq("KW") end end describe "#country" do it "returns KW" do expect(create(:kuwait_bank_account)....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/rwanda_bank_account_spec.rb
spec/models/rwanda_bank_account_spec.rb
# frozen_string_literal: true describe RwandaBankAccount do describe "#bank_account_type" do it "returns RW" do expect(create(:rwanda_bank_account).bank_account_type).to eq("RW") end end describe "#country" do it "returns RW" do expect(create(:rwanda_bank_account).country).to eq("RW") ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/purchase_integration_spec.rb
spec/models/purchase_integration_spec.rb
# frozen_string_literal: true require "spec_helper" describe PurchaseIntegration do describe "validations" do it "raises error if purchase_id is not present" do purchase_integration = build(:purchase_integration, purchase_id: nil, integration_id: create(:discord_integration).id) expect(purchase_inte...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/yearly_stat_spec.rb
spec/models/yearly_stat_spec.rb
# frozen_string_literal: true require "spec_helper" describe YearlyStat do describe "associations" do it { is_expected.to belong_to(:user) } end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/charge_spec.rb
spec/models/charge_spec.rb
# frozen_string_literal: true require "spec_helper" describe Charge, :vcr do include StripeChargesHelper describe "validations" do it "validates presence of required attributes" do charge = described_class.new expect(charge).to be_invalid expect(charge.errors.messages).to eq( order...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/balance_spec.rb
spec/models/balance_spec.rb
# frozen_string_literal: true require "spec_helper" describe Balance do let(:user) { create(:user) } let(:merchant_account) { create(:merchant_account, user:) } describe "validate_amounts_are_only_changed_when_unpaid" do let(:balance) { create(:balance, user:, merchant_account:, date: Date.today) } de...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/indian_bank_account_spec.rb
spec/models/indian_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe IndianBankAccount do describe "#bank_account_type" do it "returns Indian" do expect(create(:indian_bank_account).bank_account_type).to eq("IN") end end describe "#country" do it "returns IN" do expect(create(:indian_bank_accou...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/preorder_spec.rb
spec/models/preorder_spec.rb
# frozen_string_literal: true require "spec_helper" describe Preorder, :vcr do before do $currency_namespace = Redis::Namespace.new(:currencies, redis: $redis) end describe "mobile_json_data" do it "returns proper json for a preorder without a url redirect" do good_card = build(:chargeable) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
true
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/credit_card_spec.rb
spec/models/credit_card_spec.rb
# frozen_string_literal: true require "spec_helper" describe CreditCard do describe "after creating a credit card", :vcr do let(:chargeable) { build(:chargeable) } it "is valid" do credit_card = CreditCard.create(chargeable) expect(credit_card.valid?).to be(true) end it "has charge pro...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/device_spec.rb
spec/models/device_spec.rb
# frozen_string_literal: true require "spec_helper" describe Device do describe "creating" do it "deletes existing token if already linked with other account" do device = create(:device, token: "x" * 64, device_type: "ios") create(:device, token: "x" * 64, device_type: "ios") expect(Device.whe...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/indonesia_bank_account_spec.rb
spec/models/indonesia_bank_account_spec.rb
# frozen_string_literal: true describe IndonesiaBankAccount do describe "#bank_account_type" do it "returns Indonesia" do expect(create(:indonesia_bank_account).bank_account_type).to eq("ID") end end describe "#country" do it "returns ID" do expect(create(:indonesia_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_refund_policy_spec.rb
spec/models/product_refund_policy_spec.rb
# frozen_string_literal: true require "spec_helper" describe ProductRefundPolicy do let(:refund_policy) { create(:product_refund_policy) } describe "validations" do it "validates presence" do refund_policy = ProductRefundPolicy.new expect(refund_policy.valid?).to be false expect(refund_pol...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/user_tax_form_spec.rb
spec/models/user_tax_form_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe UserTaxForm do subject(:user_tax_form) { build(:user_tax_form) } describe "associations" do it { is_expected.to belong_to(:user) } end describe "validations" do it { is_expected.to validate_presence_of(:tax_year) } it { is_expect...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/peru_bank_account_spec.rb
spec/models/peru_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe PeruBankAccount do describe "#bank_account_type" do it "returns peru" do expect(create(:peru_bank_account).bank_account_type).to eq("PE") end end describe "#country" do it "returns PE" do expect(create(:peru_bank_account).coun...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/stripe_apple_pay_domain_spec.rb
spec/models/stripe_apple_pay_domain_spec.rb
# frozen_string_literal: true require "spec_helper" describe StripeApplePayDomain do it "validates presence of attributes" do record = StripeApplePayDomain.create() expect(record.errors.messages).to eq( user: ["can't be blank"], domain: ["can't be blank"], stripe_id: ["can't be blank"], ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/israel_bank_account_spec.rb
spec/models/israel_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe IsraelBankAccount do describe "#bank_account_type" do it "returns IL" do expect(create(:israel_bank_account).bank_account_type).to eq("IL") end end describe "#country" do it "returns IL" do expect(create(:israel_bank_account)....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sendgrid_event_info_spec.rb
spec/models/sendgrid_event_info_spec.rb
# frozen_string_literal: true require "spec_helper" describe SendgridEventInfo do describe "#for_abandoned_cart_email?" do it "returns true when the mailer class is CustomerMailer and the mailer method is abandoned_cart" do event_json = { "mailer_class" => "CustomerMailer", "mailer_method" => "abandoned_c...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/affiliate_credit_spec.rb
spec/models/affiliate_credit_spec.rb
# frozen_string_literal: true require "spec_helper" describe AffiliateCredit do describe "associations" do it { is_expected.to belong_to(:seller).class_name("User").optional(false) } it { is_expected.to belong_to(:affiliate_user).class_name("User").optional(false) } it { is_expected.to belong_to(:purcha...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/black_recurring_service_spec.rb
spec/models/black_recurring_service_spec.rb
# frozen_string_literal: true require "spec_helper" describe BlackRecurringService do describe "state transitions" do before do @black_recurring_service = create(:black_recurring_service, state: "inactive") allow_any_instance_of(User).to receive(:tier_pricing_enabled?).and_return(false) @mail...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/bolivia_bank_account_spec.rb
spec/models/bolivia_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe BoliviaBankAccount do describe "#bank_account_type" do it "returns BO" do expect(create(:bolivia_bank_account).bank_account_type).to eq("BO") end end describe "#country" do it "returns BO" do expect(create(:bolivia_bank_accoun...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/gift_spec.rb
spec/models/gift_spec.rb
# frozen_string_literal: true require "spec_helper" describe Gift do describe "saving" do it "removes leading/trailing spaces in emails" do gift = create(:gift, gifter_email: " abc@def.com ", giftee_email: " foo@bar.com ") expect(gift.gifter_email).to eq("abc@def.com") expect(gift.giftee_email...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/uk_bank_account_spec.rb
spec/models/uk_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe UkBankAccount do describe "sort_code" do describe "is 6 digits with hyphens" do let(:uk_bank_account) { build(:uk_bank_account, sort_code: "06-21-11") } it "is valid" do expect(uk_bank_account).to be_valid end end d...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/hong_kong_bank_account_spec.rb
spec/models/hong_kong_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe HongKongBankAccount do describe "#bank_account_type" do it "returns hong kong" do expect(create(:hong_kong_bank_account).bank_account_type).to eq("HK") end end describe "#country" do it "returns HK" do expect(create(:hong_kong...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/monaco_bank_account_spec.rb
spec/models/monaco_bank_account_spec.rb
# frozen_string_literal: true describe MonacoBankAccount do describe "#bank_account_type" do it "returns MC" do expect(create(:monaco_bank_account).bank_account_type).to eq("MC") end end describe "#country" do it "returns MC" do expect(create(:monaco_bank_account).country).to eq("MC") ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/japan_bank_account_spec.rb
spec/models/japan_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe JapanBankAccount do describe "#bank_account_type" do it "returns Japan" do expect(create(:japan_bank_account).bank_account_type).to eq("JP") end end describe "#country" do it "returns JP" do expect(create(:japan_bank_account)....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/romania_bank_account_spec.rb
spec/models/romania_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe RomaniaBankAccount do describe "#bank_account_type" do it "returns romania" do expect(create(:romania_bank_account).bank_account_type).to eq("RO") end end describe "#country" do it "returns RO" do expect(create(:romania_bank_a...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/jordan_bank_account_spec.rb
spec/models/jordan_bank_account_spec.rb
# frozen_string_literal: true describe JordanBankAccount do describe "#bank_account_type" do it "returns JO" do expect(create(:jordan_bank_account).bank_account_type).to eq("JO") end end describe "#country" do it "returns JO" do expect(create(:jordan_bank_account).country).to eq("JO") ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/discover_search_spec.rb
spec/models/discover_search_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe DiscoverSearch do it "can be created" do create(:discover_search) end end
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/tip_spec.rb
spec/models/tip_spec.rb
# frozen_string_literal: true describe Tip do describe "validations" do context "when value_cents is greater than 0" do it "doesn't add an error" do tip = build(:tip, value_cents: 100) expect(tip).to be_valid end end context "when value_cents is zero" do it "adds an err...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/uzbekistan_bank_account_spec.rb
spec/models/uzbekistan_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe UzbekistanBankAccount do describe "#bank_account_type" do it "returns UZ" do expect(create(:uzbekistan_bank_account).bank_account_type).to eq("UZ") end end describe "#country" do it "returns UZ" do expect(create(:uzbekistan_ba...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/dominican_republic_bank_account_spec.rb
spec/models/dominican_republic_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe DominicanRepublicBankAccount do let(:bank_account) { build(:dominican_republic_bank_account) } describe "#bank_account_type" do it "returns DO" do expect(bank_account.bank_account_type).to eq("DO") end end describe "#country" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/affiliate_spec.rb
spec/models/affiliate_spec.rb
# frozen_string_literal: true require "spec_helper" describe Affiliate do describe "scopes" do describe "affiliate types" do let!(:direct_affiliate) { create(:direct_affiliate) } let!(:confirmed_collaborator) { create(:collaborator) } let!(:pending_collaborator) { create(:collaborator, :with_p...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/cart_spec.rb
spec/models/cart_spec.rb
# frozen_string_literal: true require "spec_helper" describe Cart do describe "associations" do describe "#alive_cart_products" do it "returns only alive cart products" do cart = create(:cart) alive_cart_product = create(:cart_product, cart:) create(:cart_product, cart:, deleted_at...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/workflow_spec.rb
spec/models/workflow_spec.rb
# frozen_string_literal: true require "spec_helper" require "shared_examples/with_filtering_support" describe Workflow do before do @product = create(:product) @workflow = create(:workflow, seller: @product.user, link: @product) @post = create(:installment, link: @product, workflow: @workflow, published...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_affiliate_spec.rb
spec/models/product_affiliate_spec.rb
# frozen_string_literal: true require "spec_helper" describe ProductAffiliate do describe "associations" do it { is_expected.to belong_to(:affiliate) } it { is_expected.to belong_to(:product).class_name("Link") } end describe "validations" do context "when another record exists" do it "valida...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/uae_bank_account_spec.rb
spec/models/uae_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe UaeBankAccount do describe "#bank_account_type" do it "returns AE" do expect(create(:uae_bank_account).bank_account_type).to eq("AE") end end describe "#country" do it "returns AE" do expect(create(:uae_bank_account).country)....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/costa_rica_bank_account_spec.rb
spec/models/costa_rica_bank_account_spec.rb
# frozen_string_literal: true describe CostaRicaBankAccount do describe "#bank_account_type" do it "returns Costa Rica" do expect(create(:costa_rica_bank_account).bank_account_type).to eq("CR") end end describe "#country" do it "returns CR" do expect(create(:costa_rica_bank_account).coun...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/utm_link_visit_spec.rb
spec/models/utm_link_visit_spec.rb
# frozen_string_literal: true require "spec_helper" describe UtmLinkVisit do describe "associations" do it { is_expected.to belong_to(:utm_link) } it { is_expected.to belong_to(:user).optional } it { is_expected.to have_many(:utm_link_driven_sales).dependent(:destroy) } it { is_expected.to have_many...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/confirmed_follower_event_spec.rb
spec/models/confirmed_follower_event_spec.rb
# frozen_string_literal: true require "spec_helper" describe ConfirmedFollowerEvent 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: { "followed_user_id" => 123, "name"...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/video_file_spec.rb
spec/models/video_file_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe VideoFile, type: :model do it "schedules a job to analyze the file after creation" do video_file = create(:video_file) expect(AnalyzeFileWorker).to have_enqueued_sidekiq_job(video_file.id, VideoFile.name) end describe "#url" do it ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/benin_bank_account_spec.rb
spec/models/benin_bank_account_spec.rb
# frozen_string_literal: true describe BeninBankAccount do describe "#bank_account_type" do it "returns BJ" do expect(create(:benin_bank_account).bank_account_type).to eq("BJ") end end describe "#country" do it "returns BJ" do expect(create(:benin_bank_account).country).to eq("BJ") e...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/pakistan_bank_account_spec.rb
spec/models/pakistan_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe PakistanBankAccount do describe "#bank_account_type" do it "returns Pakistan" do expect(create(:pakistan_bank_account).bank_account_type).to eq("PK") end end describe "#country" do it "returns PK" do expect(create(:pakistan_ba...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/url_redirect_spec.rb
spec/models/url_redirect_spec.rb
# frozen_string_literal: true require "spec_helper" describe UrlRedirect do before do allow_any_instance_of(Aws::S3::Object).to receive(:content_length).and_return(1_000_000) @good_kindle_email = "maxwell_1234@kindle.com" end it "has a token that is unique" do url_redirect = create(:url_redirect) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
true
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/ach_account_spec.rb
spec/models/ach_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe AchAccount do describe "#routing_number" do let(:ach_account) { build(:ach_account) } describe "is valid" do before do expect(described_class).to receive(:routing_number_valid?).and_return(true) end it "does not valid" ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/user_compliance_info_spec.rb
spec/models/user_compliance_info_spec.rb
# frozen_string_literal: true require "spec_helper" describe UserComplianceInfo do describe "encrypted" do describe "individual_tax_id" do let(:user_compliance_info) { create(:user_compliance_info, individual_tax_id: "123456789") } it "is encrypted" do expect(user_compliance_info.individual...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/third_party_analytic_spec.rb
spec/models/third_party_analytic_spec.rb
# frozen_string_literal: true require "spec_helper" describe ThirdPartyAnalytic do before do @user = create(:user) @product = create(:product, user: @user) end describe "#save_third_party_analytics" do describe "new analytics" do it "creates a new third_party_analytic for creator" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/installment_rule_spec.rb
spec/models/installment_rule_spec.rb
# frozen_string_literal: true require "spec_helper" describe InstallmentRule do describe "version" do before do @product = create(:product) @post = create(:installment, link: @product, installment_type: "product") @post_rule = create(:installment_rule, installment: @post, to_be_published_at: 1...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/czech_republic_bank_account_spec.rb
spec/models/czech_republic_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe CzechRepublicBankAccount do describe "#bank_account_type" do it "returns CZ" do expect(create(:czech_republic_bank_account).bank_account_type).to eq("CZ") end end describe "#country" do it "returns CZ" do expect(create(:czech_...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/variant_category_spec.rb
spec/models/variant_category_spec.rb
# frozen_string_literal: true require "spec_helper" describe VariantCategory do describe "scopes" do describe ".is_tier_category" do it "returns variant categories with title 'Tier'" do create(:variant_category) tier_category = create(:variant_category, title: "Tier") second_tier_c...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/south_africa_bank_account_spec.rb
spec/models/south_africa_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe SouthAfricaBankAccount do describe "#bank_account_type" do it "returns ZA" do expect(create(:south_africa_bank_account).bank_account_type).to eq("ZA") end end describe "#country" do it "returns ZA" do expect(create(:south_afri...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/cart_product_spec.rb
spec/models/cart_product_spec.rb
# frozen_string_literal: true require "spec_helper" describe CartProduct do describe "callbacks" do it "assigns default url parameters after initialization" do cart_product = build(:cart_product) expect(cart_product.url_parameters).to eq({}) end it "assigns accepted offer details after init...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/upsell_spec.rb
spec/models/upsell_spec.rb
# frozen_string_literal: true require "spec_helper" describe Upsell do describe "validations" do context "when any products don't belong to the seller" do before do @upsell = build(:upsell, selected_products: [create(:product)]) end it "adds an error" do expect(@upsell.valid?)...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/asset_preview_spec.rb
spec/models/asset_preview_spec.rb
# frozen_string_literal: true require "spec_helper" describe AssetPreview, :vcr do describe "Attachment" do it "scales down a big image and keeps original" do asset_preview = create(:asset_preview) expect(asset_preview.file.url).to match("#{AWS_S3_ENDPOINT}/#{S3_BUCKET}/#{asset_preview.file.key}") ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/utm_link_spec.rb
spec/models/utm_link_spec.rb
# frozen_string_literal: true require "spec_helper" describe UtmLink do describe "associations" do it { is_expected.to belong_to(:seller).class_name("User").optional(false) } it { is_expected.to belong_to(:target_resource).optional(true) } it { is_expected.to have_many(:utm_link_visits).dependent(:destr...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/malaysia_bank_account_spec.rb
spec/models/malaysia_bank_account_spec.rb
# frozen_string_literal: true describe MalaysiaBankAccount do describe "#bank_account_type" do it "returns MY" do expect(create(:malaysia_bank_account).bank_account_type).to eq("MY") end end describe "#country" do it "returns MY" do expect(create(:malaysia_bank_account).country).to eq("M...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/subtitle_file_spec.rb
spec/models/subtitle_file_spec.rb
# frozen_string_literal: true require "spec_helper" describe SubtitleFile do describe "validations" do describe "file types" do shared_examples "common invalid type behavior" do |file_type:| before do @subtitle = build(:subtitle_file, url: "subtitle.#{file_type}") end it...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/dropbox_file_spec.rb
spec/models/dropbox_file_spec.rb
# frozen_string_literal: true require "spec_helper" describe DropboxFile do describe "validations" do it "does not allow you to create a dropbox file without a dropbox url" do dropbox_file = DropboxFile.new(dropbox_url: nil) expect(dropbox_file.valid?).to eq false end end describe "#multipa...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/legacy_permalink_spec.rb
spec/models/legacy_permalink_spec.rb
# frozen_string_literal: true require "spec_helper" describe LegacyPermalink do describe "validations" do describe "product" do it "must be present" do expect(build(:legacy_permalink, product: nil)).to_not be_valid end end describe "permalink" do it "must be present" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/paraguay_bank_account_spec.rb
spec/models/paraguay_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe ParaguayBankAccount do describe "#bank_account_type" do it "returns PY" do expect(create(:paraguay_bank_account).bank_account_type).to eq("PY") end end describe "#country" do it "returns PY" do expect(create(:paraguay_bank_acc...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/variant_price_spec.rb
spec/models/variant_price_spec.rb
# frozen_string_literal: true require "spec_helper" describe VariantPrice do describe "associations" do it "belongs to a variant" do price = create(:variant_price) expect(price.variant).to be_a Variant end end describe "validations" do it "requires that the variant is present" do ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/integration_spec.rb
spec/models/integration_spec.rb
# frozen_string_literal: true require "spec_helper" describe Integration do describe "#type_for" do it "returns the type for the given integration name" do { Integration::CIRCLE => CircleIntegration.name, Integration::DISCORD => DiscordIntegration.name, Integration::ZOOM => ZoomIntegration...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/liechtenstein_bank_account_spec.rb
spec/models/liechtenstein_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe LiechtensteinBankAccount do describe "#bank_account_type" do it "returns LI" do expect(create(:liechtenstein_bank_account).bank_account_type).to eq("LI") end end describe "#country" do it "returns LI" do expect(create(:liechte...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/balance_transaction_spec.rb
spec/models/balance_transaction_spec.rb
# frozen_string_literal: true require "spec_helper" describe BalanceTransaction, :vcr do describe BalanceTransaction::Amount do describe "create_issued_amount_for_affiliate" do let(:issued_affiliate_cents) { 10_00 } let(:flow_of_funds) { raise "You must define `flow_of_funds`." } let(:amount) ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
true
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/team_membership_spec.rb
spec/models/team_membership_spec.rb
# frozen_string_literal: true require "spec_helper" describe TeamMembership do describe "validations" do let(:user) { create(:user) } let(:seller) { create(:named_seller) } it "requires user, seller, role to be present" do team_membership = TeamMembership.new expect(team_membership.valid?)....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/antigua_and_barbuda_bank_account_spec.rb
spec/models/antigua_and_barbuda_bank_account_spec.rb
# frozen_string_literal: true describe AntiguaAndBarbudaBankAccount do describe "#bank_account_type" do it "returns AG" do expect(create(:antigua_and_barbuda_bank_account).bank_account_type).to eq("AG") end end describe "#country" do it "returns AG" do expect(create(:antigua_and_barbuda_...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/european_bank_account_spec.rb
spec/models/european_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe EuropeanBankAccount do describe "#bank_account_type" do it "returns european" do expect(create(:european_bank_account).bank_account_type).to eq("EU") expect(create(:fr_bank_account).bank_account_type).to eq("EU") expect(create(:nl_ba...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/base_variant_integration_spec.rb
spec/models/base_variant_integration_spec.rb
# frozen_string_literal: true require "spec_helper" describe BaseVariantIntegration do describe "validations" do before do @integration = create(:circle_integration) @variant = create(:variant) end it "raises error if base_variant_id is not present" do base_variant_integration = BaseV...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/seller_refund_policy_spec.rb
spec/models/seller_refund_policy_spec.rb
# frozen_string_literal: true require "spec_helper" describe SellerRefundPolicy do let(:seller) { create(:named_seller) } let(:refund_policy) { seller.refund_policy } describe "validations" do it "validates presence" do refund_policy = SellerRefundPolicy.new expect(refund_policy.valid?).to be ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/call_limitation_info_spec.rb
spec/models/call_limitation_info_spec.rb
# frozen_string_literal: true describe CallLimitationInfo do describe "validations" do context "call is not a call product" do let(:call_limitation_info) { build(:call_limitation_info, call: create(:product)) } it "adds an error" do expect(call_limitation_info).not_to be_valid expect...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/resource_subscription_spec.rb
spec/models/resource_subscription_spec.rb
# frozen_string_literal: true require "spec_helper" describe ResourceSubscription do before do @user = create(:user) end describe "#assign_content_type_to_json_for_zapier" do it "sets content_type to application/json for Zapier subscriptions" do resource_subscription = create(:resource_subscripti...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/email_event_spec.rb
spec/models/email_event_spec.rb
# frozen_string_literal: true require "spec_helper" describe EmailEvent do let(:emails) { ["one@example.com", "two@example.com", "three@example.com"] } let(:emails_digests) { emails.map { Digest::SHA1.hexdigest(_1).first(12) } } let(:email) { emails.first } let(:email_digest) { emails_digests.first } let(:t...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/blocked_customer_object_spec.rb
spec/models/blocked_customer_object_spec.rb
# frozen_string_literal: true require "spec_helper" describe BlockedCustomerObject do describe "validations" do subject(:blocked_customer_object) { build(:blocked_customer_object, object_type: nil, object_value: nil) } describe "presence" do it "doesn't allow an empty seller_id" do blocked_cu...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/namibia_bank_account_spec.rb
spec/models/namibia_bank_account_spec.rb
# frozen_string_literal: true describe NamibiaBankAccount do describe "#bank_account_type" do it "returns NA" do expect(create(:namibia_bank_account).bank_account_type).to eq("NA") end end describe "#country" do it "returns NA" do expect(create(:namibia_bank_account).country).to eq("NA")...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/early_fraud_warning_spec.rb
spec/models/early_fraud_warning_spec.rb
# frozen_string_literal: true require "spec_helper" describe EarlyFraudWarning do describe "validations" do describe "for Purchase" do let(:purchase_efw) { create(:early_fraud_warning) } it "validates uniqueness of processor_id" do new_record = build(:early_fraud_warning, processor_id: purc...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/dispute_spec.rb
spec/models/dispute_spec.rb
# frozen_string_literal: true require "spec_helper" describe Dispute do describe "creation" do it "sets seller when creating from a purchase" do dispute = create(:dispute) expect(dispute.seller).to eq(dispute.purchase.seller) end it "sets seller when creating from a charge" do dispute...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/creator_contacting_customers_email_info_spec.rb
spec/models/creator_contacting_customers_email_info_spec.rb
# frozen_string_literal: true require "spec_helper" describe CreatorContactingCustomersEmailInfo do describe "state transitions" do it "transitions to sent" do email_info = create(:creator_contacting_customers_email_info) email_info.update_attribute(:delivered_at, Time.current) expect(email_in...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/sku_spec.rb
spec/models/sku_spec.rb
# frozen_string_literal: true require "spec_helper" require "shared_examples/max_purchase_count_concern" describe Sku do it_behaves_like "MaxPurchaseCount concern", :sku describe "sku_category_name" do before do link = create(:product) @variant_category_1 = create(:variant_category, link:, title:...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/thumbnail_spec.rb
spec/models/thumbnail_spec.rb
# frozen_string_literal: true require "spec_helper" describe Thumbnail do before do @product = create(:product) end describe "#validate_file" do it "does not save if no file attached" do thumbnail = Thumbnail.new(product: @product) expect(thumbnail.save).to eq(false) expect(thumbnail....
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/order_spec.rb
spec/models/order_spec.rb
# frozen_string_literal: true require "spec_helper" describe Order do let(:product) { create(:product) } let(:purchase) { create(:purchase, link: product) } let(:order) { create(:order, purchases: [purchase]) } describe "#receipt_for_gift_receiver?" do context "when the purchase is not for a gift receive...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/canadian_bank_account_spec.rb
spec/models/canadian_bank_account_spec.rb
# frozen_string_literal: true require "spec_helper" describe CanadianBankAccount do describe "transit_number" do describe "is 5 digits" do let(:canadian_bank_account) { build(:canadian_bank_account, transit_number: "12345") } it "is valid" do expect(canadian_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/subscription_spec.rb
spec/models/subscription_spec.rb
# frozen_string_literal: true require "spec_helper" describe Subscription, :vcr do include CurrencyHelper include ManageSubscriptionHelpers let(:seller) { create(:user) } before do @product = create(:subscription_product, user: seller, is_licensed: true) @subscription = create(:subscription, user: c...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
true
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/ecuador_bank_account_spec.rb
spec/models/ecuador_bank_account_spec.rb
# frozen_string_literal: true describe EcuadorBankAccount do describe "#bank_account_type" do it "returns EC" do expect(create(:ecuador_bank_account).bank_account_type).to eq("EC") end end describe "#country" do it "returns EC" do expect(create(:ecuador_bank_account).country).to eq("EC")...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/service_charge_spec.rb
spec/models/service_charge_spec.rb
# frozen_string_literal: true require "spec_helper" describe ServiceCharge, :vcr do describe "scopes" do describe "successful" do before do @successful_service_charge = create(:service_charge, state: "successful") @failed_service_charge = create(:service_charge, state: "failed") end ...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/payment_option_spec.rb
spec/models/payment_option_spec.rb
# frozen_string_literal: true require "spec_helper" describe PaymentOption do describe "validation" do it "considers a PaymentOption to be invalid unless all required information is provided" do payment_option = PaymentOption.new expect(payment_option.valid?).to eq false product = create(:sub...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/call_availability_spec.rb
spec/models/call_availability_spec.rb
# frozen_string_literal: true describe CallAvailability do describe "normalizations" do it "drops sub-minute precision from start_time and end_time when assigning" do call_availability = build( :call_availability, start_time: DateTime.parse("May 1 2024 10:28:01.123456 UTC"), end_tim...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/product_installment_plan_spec.rb
spec/models/product_installment_plan_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe ProductInstallmentPlan do subject(:product_installment_plan) { build(:product_installment_plan) } describe "validations" do it { is_expected.to validate_presence_of(:number_of_installments) } it { is_expected.to validate_numericality_of(:...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/resend_event_info_spec.rb
spec/models/resend_event_info_spec.rb
# frozen_string_literal: true require "spec_helper" RSpec.describe ResendEventInfo do before do Feature.activate(:resend) Feature.activate(:force_resend) end let(:email) { "to@example.com" } let(:resend_header_names) { MailerInfo::FIELD_NAMES.map { MailerInfo.header_name(_1) } } let(:mailer_headers...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/license_spec.rb
spec/models/license_spec.rb
# frozen_string_literal: true require "spec_helper" require "digest" describe License do describe "validations" do it "does not allow users to unset token" do license = create(:license) license.serial = nil expect(license).to_not be_valid end it "populates serial correctly on new lice...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false
antiwork/gumroad
https://github.com/antiwork/gumroad/blob/638f6c3a40b23b907c09f6881d4df18339da069c/spec/models/north_macedonia_bank_account_spec.rb
spec/models/north_macedonia_bank_account_spec.rb
# frozen_string_literal: true describe NorthMacedoniaBankAccount do describe "#bank_account_type" do it "returns Macedonia" do expect(create(:north_macedonia_bank_account).bank_account_type).to eq("MK") end end describe "#country" do it "returns MK" do expect(create(:north_macedonia_bank...
ruby
MIT
638f6c3a40b23b907c09f6881d4df18339da069c
2026-01-04T15:39:11.815677Z
false