source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/integration_spec.rb
Ruby
mit
8,966
main
2,982
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/brunei_bank_account_spec.rb
Ruby
mit
8,966
main
1,798
# frozen_string_literal: true describe BruneiBankAccount do describe "#bank_account_type" do it "returns BN" do expect(create(:brunei_bank_account).bank_account_type).to eq("BN") end end describe "#country" do it "returns BN" do expect(create(:brunei_bank_account).country).to eq("BN") ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/gibraltar_bank_account_spec.rb
Ruby
mit
8,966
main
3,629
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/angola_bank_account_spec.rb
Ruby
mit
8,966
main
1,339
# frozen_string_literal: true require "spec_helper" describe AngolaBankAccount do describe "#bank_account_type" do it "returns AO" do expect(create(:angola_bank_account).bank_account_type).to eq("AO") end end describe "#country" do it "returns AO" do expect(create(:angola_bank_account)....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/seller_profile_spec.rb
Ruby
mit
8,966
main
2,252
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/ach_account_spec.rb
Ruby
mit
8,966
main
7,956
# 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" ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/czech_republic_bank_account_spec.rb
Ruby
mit
8,966
main
2,270
# 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_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/call_availability_spec.rb
Ruby
mit
8,966
main
2,925
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/call_limitation_info_spec.rb
Ruby
mit
8,966
main
4,017
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/tunisia_bank_account_spec.rb
Ruby
mit
8,966
main
2,007
# frozen_string_literal: true describe TunisiaBankAccount do describe "#bank_account_type" do it "returns Tunisia" do expect(create(:tunisia_bank_account).bank_account_type).to eq("TN") end end describe "#country" do it "returns TN" do expect(create(:tunisia_bank_account).country).to eq(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/namibia_bank_account_spec.rb
Ruby
mit
8,966
main
2,636
# 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")...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/morocco_bank_account_spec.rb
Ruby
mit
8,966
main
2,316
# 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(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/community_notification_setting_spec.rb
Ruby
mit
8,966
main
691
# frozen_string_literal: true require "spec_helper" RSpec.describe CommunityNotificationSetting do subject(:notification_setting) { build(:community_notification_setting) } describe "associations" do it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:seller).class_name("User") } end ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/singaporean_bank_account_spec.rb
Ruby
mit
8,966
main
2,808
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/trinidad_and_tobago_bank_account_spec.rb
Ruby
mit
8,966
main
2,827
# frozen_string_literal: true require "spec_helper" describe TrinidadAndTobagoBankAccount do describe "#bank_account_type" do it "returns TT" do expect(create(:trinidad_and_tobago_bank_account).bank_account_type).to eq("TT") end end describe "#country" do it "returns TT" do expect(creat...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/preorder_link_spec.rb
Ruby
mit
8,966
main
8,355
# frozen_string_literal: true require "spec_helper" describe PreorderLink do describe "#release!" do before do @product = create(:product_with_pdf_file, price_cents: 600, is_in_preorder_state: true) create(:rich_content, entity: @product, description: [{ "type" => "fileEmbed", "attrs" => { "id" => @...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/consumption_event_spec.rb
Ruby
mit
8,966
main
3,692
# 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) { ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/sent_post_email_spec.rb
Ruby
mit
8,966
main
2,741
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/credit_spec.rb
Ruby
mit
8,966
main
20,426
# frozen_string_literal: true require "spec_helper" describe Credit do describe "create_for_credit!" do let(:user) { create(:user) } let(:merchant_account) { create(:merchant_account, user:) } it "assigns to the Gumroad Stripe merchant account" do credit = Credit.create_for_credit!(user:, amount_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/video_file_spec.rb
Ruby
mit
8,966
main
1,931
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/swiss_bank_account_spec.rb
Ruby
mit
8,966
main
2,155
# 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)....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/balance_transaction_spec.rb
Ruby
mit
8,966
main
58,939
# 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) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/installment_rule_spec.rb
Ruby
mit
8,966
main
3,623
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/affiliate_spec.rb
Ruby
mit
8,966
main
11,238
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/kuwait_bank_account_spec.rb
Ruby
mit
8,966
main
1,881
# 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)....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/botswana_bank_account_spec.rb
Ruby
mit
8,966
main
2,817
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/installment_spec.rb
Ruby
mit
8,966
main
60,126
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/product_tagging_spec.rb
Ruby
mit
8,966
main
1,400
# 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") ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/affiliate_request_spec.rb
Ruby
mit
8,966
main
15,610
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/bahamas_bank_account_spec.rb
Ruby
mit
8,966
main
1,346
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/mozambique_bank_account_spec.rb
Ruby
mit
8,966
main
1,413
# frozen_string_literal: true describe MozambiqueBankAccount do describe "#bank_account_type" do it "returns MZ" do expect(create(:mozambique_bank_account).bank_account_type).to eq("MZ") end end describe "#country" do it "returns MZ" do expect(create(:mozambique_bank_account).country).to...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/payment_option_spec.rb
Ruby
mit
8,966
main
2,043
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/kenya_bank_account_spec.rb
Ruby
mit
8,966
main
1,327
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/pakistan_bank_account_spec.rb
Ruby
mit
8,966
main
2,671
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/vietnam_bank_account_spec.rb
Ruby
mit
8,966
main
1,337
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/comment_spec.rb
Ruby
mit
8,966
main
9,542
# frozen_string_literal: true require "spec_helper" describe Comment do describe "validations" do describe "content length" do context "when content is within the configured character limit" do subject(:comment) { build(:comment, commentable: create(:published_installment), content: "a" * 10_000) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/self_service_affiliate_product_spec.rb
Ruby
mit
8,966
main
5,896
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/bangladesh_bank_account_spec.rb
Ruby
mit
8,966
main
2,250
# frozen_string_literal: true describe BangladeshBankAccount do describe "#bank_account_type" do it "returns BD" do expect(create(:bangladesh_bank_account).bank_account_type).to eq("BD") end end describe "#country" do it "returns BD" do expect(create(:bangladesh_bank_account).country).to...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/product_integration_spec.rb
Ruby
mit
8,966
main
2,059
# 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....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/ecuador_bank_account_spec.rb
Ruby
mit
8,966
main
2,570
# 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")...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/event_spec.rb
Ruby
mit
8,966
main
741
# 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: ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/customer_email_info_spec.rb
Ruby
mit
8,966
main
4,166
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/senegal_bank_account_spec.rb
Ruby
mit
8,966
main
2,241
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/mauritius_bank_account_spec.rb
Ruby
mit
8,966
main
918
# frozen_string_literal: true describe MauritiusBankAccount do describe "#bank_account_type" do it "returns MU" do expect(create(:mauritius_bank_account).bank_account_type).to eq("MU") end end describe "#country" do it "returns MA" do expect(create(:mauritius_bank_account).country).to eq...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/guyana_bank_account_spec.rb
Ruby
mit
8,966
main
1,879
# 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") ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/order_spec.rb
Ruby
mit
8,966
main
8,869
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/bahrain_bank_account_spec.rb
Ruby
mit
8,966
main
906
# 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")...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/affiliate_credit_spec.rb
Ruby
mit
8,966
main
5,112
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/service_charge_spec.rb
Ruby
mit
8,966
main
5,487
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/nigeria_bank_account_spec.rb
Ruby
mit
8,966
main
906
# 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")...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/subscription_plan_change_spec.rb
Ruby
mit
8,966
main
4,615
# frozen_string_literal: true require "spec_helper" describe SubscriptionPlanChange do describe "validations" do it "validates presence of tier for a tiered membership" do subscription = create(:subscription, link: create(:membership_product)) record = build(:subscription_plan_change, subscription:,...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/workflow_spec.rb
Ruby
mit
8,966
main
14,283
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/tip_spec.rb
Ruby
mit
8,966
main
511
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/uruguay_bank_account_spec.rb
Ruby
mit
8,966
main
1,507
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/bosnia_and_herzegovina_bank_account_spec.rb
Ruby
mit
8,966
main
994
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/product_installment_plan_spec.rb
Ruby
mit
8,966
main
9,570
# 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(:...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/merchant_account_spec.rb
Ruby
mit
8,966
main
5,304
# frozen_string_literal: true require "spec_helper" describe MerchantAccount do describe ".paypal" do it "returns records with the paypal charge processor id" do MerchantAccount.destroy_all create(:merchant_account) create(:merchant_account_paypal, charge_processor_id: BraintreeChargeProcessor...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/niger_bank_account_spec.rb
Ruby
mit
8,966
main
820
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/resend_event_info_spec.rb
Ruby
mit
8,966
main
8,531
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/card_bank_account_spec.rb
Ruby
mit
8,966
main
3,292
# frozen_string_literal: true require "spec_helper" describe CardBankAccount, :vcr do it "only allows debit cards" do card_bank_account = create(:card_bank_account) expect(card_bank_account.credit_card.funding_type).to eq(ChargeableFundingType::DEBIT) expect(card_bank_account.valid?).to be(true) ca...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/installment_event_spec.rb
Ruby
mit
8,966
main
363
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/billing_detail_spec.rb
Ruby
mit
8,966
main
2,712
# frozen_string_literal: true require "spec_helper" describe BillingDetail do let(:user) { create(:user) } describe "validations" do it "requires full_name, street_address, city, zip_code, country_code" do billing_detail = described_class.new(purchaser: user) expect(billing_detail).not_to be_vali...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/commission_spec.rb
Ruby
mit
8,966
main
15,292
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/denmark_bank_account_spec.rb
Ruby
mit
8,966
main
2,189
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/blocked_object_spec.rb
Ruby
mit
8,966
main
6,231
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/bulgaria_bank_account_spec.rb
Ruby
mit
8,966
main
2,207
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/kazakhstan_bank_account_spec.rb
Ruby
mit
8,966
main
1,137
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/url_redirect_spec.rb
Ruby
mit
8,966
main
44,862
# 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) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/iceland_bank_account_spec.rb
Ruby
mit
8,966
main
1,074
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/sales_related_products_info_spec.rb
Ruby
mit
8,966
main
7,870
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/legacy_permalink_spec.rb
Ruby
mit
8,966
main
1,380
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/product_folder_spec.rb
Ruby
mit
8,966
main
322
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/sri_lanka_bank_account_spec.rb
Ruby
mit
8,966
main
2,318
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/credit_card_spec.rb
Ruby
mit
8,966
main
5,777
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/mexico_bank_account_spec.rb
Ruby
mit
8,966
main
2,143
# frozen_string_literal: true require "spec_helper" describe MexicoBankAccount do describe "#bank_account_type" do it "returns mexico" do expect(create(:mexico_bank_account).bank_account_type).to eq("MX") end end describe "#country" do it "returns MX" do expect(create(:mexico_bank_accou...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/last_read_community_chat_message_spec.rb
Ruby
mit
8,966
main
4,441
# frozen_string_literal: true require "spec_helper" RSpec.describe LastReadCommunityChatMessage do subject(:last_read_message) { build(:last_read_community_chat_message) } describe "associations" do it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:community) } it { is_expected.to...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/staff_picked_product_spec.rb
Ruby
mit
8,966
main
719
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/community_chat_recap_spec.rb
Ruby
mit
8,966
main
1,545
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/european_bank_account_spec.rb
Ruby
mit
8,966
main
2,770
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/ghana_bank_account_spec.rb
Ruby
mit
8,966
main
2,053
# frozen_string_literal: true describe GhanaBankAccount do describe "#bank_account_type" do it "returns GH" do expect(create(:ghana_bank_account).bank_account_type).to eq("GH") end end describe "#country" do it "returns GH" do expect(create(:ghana_bank_account).country).to eq("GH") e...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/seller_profile_featured_product_section_spec.rb
Ruby
mit
8,966
main
976
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/sku_spec.rb
Ruby
mit
8,966
main
2,900
# 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:...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/dispute_evidence_spec.rb
Ruby
mit
8,966
main
9,704
# frozen_string_literal: true require "spec_helper" describe DisputeEvidence do let(:dispute_evidence) do DisputeEvidence.create!( dispute: create(:dispute), purchased_at: "", customer_purchase_ip: "", customer_email: " joe@example.com", customer_name: " Joe Doe ", billing_ad...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/resource_subscription_spec.rb
Ruby
mit
8,966
main
812
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/laos_bank_account_spec.rb
Ruby
mit
8,966
main
1,552
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/philippines_bank_account_spec.rb
Ruby
mit
8,966
main
2,439
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/community_chat_message_spec.rb
Ruby
mit
8,966
main
1,038
# frozen_string_literal: true require "spec_helper" RSpec.describe CommunityChatMessage do subject(:community_chat_message) { build(:community_chat_message) } describe "associations" do it { is_expected.to belong_to(:community) } it { is_expected.to belong_to(:user) } it { is_expected.to have_many(:l...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/tanzania_bank_account_spec.rb
Ruby
mit
8,966
main
2,673
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/seller_refund_policy_spec.rb
Ruby
mit
8,966
main
1,897
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/payment_spec.rb
Ruby
mit
8,966
main
36,282
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/oauth_application_spec.rb
Ruby
mit
8,966
main
8,645
# frozen_string_literal: true require "spec_helper" describe OauthApplication do describe "validity" do before do @user = create(:user) end it "does not validate name uniqueness" do create(:oauth_application, owner: @user, name: :foo) expect(build(:oauth_application, owner: @user, nam...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/sendgrid_event_info_spec.rb
Ruby
mit
8,966
main
1,122
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/community_chat_recap_run_spec.rb
Ruby
mit
8,966
main
8,217
# frozen_string_literal: true require "spec_helper" RSpec.describe CommunityChatRecapRun do subject(:recap_run) { build(:community_chat_recap_run) } describe "associations" do it { is_expected.to have_many(:community_chat_recaps).dependent(:destroy) } end describe "validations" do it { is_expected.t...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/japan_bank_account_spec.rb
Ruby
mit
8,966
main
6,253
# 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)....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/product_files_archive_spec.rb
Ruby
mit
8,966
main
36,820
# frozen_string_literal: true require "spec_helper" describe ProductFilesArchive do describe "callbacks" do it "saves `digest` when transitioning to the 'in_progress' state" do product = create(:product_with_files) product_files_archive = product.product_files_archives.create!(product_files: product...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/post_email_blast_spec.rb
Ruby
mit
8,966
main
5,368
# 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:...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/dropbox_file_spec.rb
Ruby
mit
8,966
main
3,063
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/qatar_bank_account_spec.rb
Ruby
mit
8,966
main
1,247
# frozen_string_literal: true require "spec_helper" describe QatarBankAccount do describe "#bank_account_type" do it "returns QA" do expect(create(:qatar_bank_account).bank_account_type).to eq("QA") end end describe "#country" do it "returns QA" do expect(create(:qatar_bank_account).cou...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/product_refund_policy_spec.rb
Ruby
mit
8,966
main
5,442
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/public_file_spec.rb
Ruby
mit
8,966
main
7,453
# frozen_string_literal: true require "spec_helper" describe PublicFile do describe "associations" do it { is_expected.to belong_to(:seller).class_name("User").optional } it { is_expected.to belong_to(:resource).optional(false) } it { is_expected.to have_one_attached(:file) } end describe "validati...