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/presenters/receipt_presenter/payment_info_spec.rb
Ruby
mit
8,966
main
31,134
# frozen_string_literal: true require "spec_helper" require "shared_examples/receipt_presenter_concern" describe ReceiptPresenter::PaymentInfo do include ActionView::Helpers::UrlHelper let(:seller) { create(:named_seller) } let(:product) { create(:product, user: seller, name: "Digital product") } let(:purcha...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/presenters/receipt_presenter/giftee_manage_subscription_spec.rb
Ruby
mit
8,966
main
1,523
# frozen_string_literal: true require "spec_helper" describe ReceiptPresenter::GifteeManageSubscription do let(:chargeable) { create(:membership_purchase, gift_received: create(:gift), is_gift_receiver_purchase: true) } let(:subscription) { chargeable.subscription } let(:presenter) { described_class.new(chargea...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/timestamp_scopes_spec.rb
Ruby
mit
8,966
main
3,434
# frozen_string_literal: true require "spec_helper" describe TimestampScopes do before do @purchase = create(:purchase, created_at: Time.utc(2020, 3, 9, 6, 30)) # Sun, 08 Mar 2020 23:30:00 PDT -07:00 end describe ".created_between" do it "returns records matching range" do expect(Purchase.created...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/sendable_to_kindle_spec.rb
Ruby
mit
8,966
main
2,410
# frozen_string_literal: true describe SendableToKindle do describe "#send_to_kindle" do before do @product_file = create(:product_file) end it "raises an error if the kindle email is invalid" do expect { @product_file.send_to_kindle("example@example.org") }.to raise_error(ArgumentError).wit...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/elasticsearch_model_async_callbacks_spec.rb
Ruby
mit
8,966
main
2,774
# frozen_string_literal: true describe ElasticsearchModelAsyncCallbacks do before do @model = create_mock_model @model.include(described_class) @model.const_set("ATTRIBUTE_TO_SEARCH_FIELDS", "title" => "title") @multiplier = 2 # we're queuing index and updates jobs twice to mitigate replica lag issue...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/cdn_deletable_spec.rb
Ruby
mit
8,966
main
1,691
# frozen_string_literal: true require "spec_helper" describe CdnDeletable do describe ".alive_in_cdn" do it "returns only those records which have `deleted_from_cdn_at` set to a NULL value" do create(:product_file, deleted_from_cdn_at: Time.current) product_file = create(:product_file) expect...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/s3_retrievable_spec.rb
Ruby
mit
8,966
main
6,908
# frozen_string_literal: true require "spec_helper" describe "S3Retrievable" do let!(:model) do model = create_mock_model do |t| t.string :url end model.attr_accessor :user model.include S3Retrievable model.has_s3_fields :url model end subject(:s3_retrievable_object) do model....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/with_file_properties_spec.rb
Ruby
mit
8,966
main
10,586
# frozen_string_literal: true require "spec_helper" describe WithFileProperties do PROPERTIES = %i[size duration width height framerate bitrate pagelength].freeze def stub_for_word_doc output_double = double allow(output_double).to receive(:output).and_return("Number of Pages = 2") allow(Subexec).to ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/subdomain_spec.rb
Ruby
mit
8,966
main
2,999
# frozen_string_literal: true require "spec_helper" describe Subdomain do before do @seller1 = create(:user) @seller1.username = "test_user" # old style username @seller1.save(validate: false) @seller2 = create(:user, username: "testuser2") # new style username @seller3 = create(:user, usernam...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/obfuscate_ids_spec.rb
Ruby
mit
8,966
main
1,178
# frozen_string_literal: true require "spec_helper" describe "ObfuscateIds" do let(:raw_id) { Faker::Number.number(digits: 10) } it "decrypts the id correctly" do encrypted_id = ObfuscateIds.encrypt(raw_id) expect(encrypted_id).to_not eq raw_id.to_s encrypted_id_without_padding = ObfuscateIds.encryp...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/integrations_spec.rb
Ruby
mit
8,966
main
1,206
# frozen_string_literal: true require "spec_helper" describe Integrations do describe "#find_integration_by_name" do context "when called on a Link record" do # TODO: Change one of the integrations to have a different type after newer ones are added it "returns the first integration of the given typ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/with_product_files_spec.rb
Ruby
mit
8,966
main
36,531
# frozen_string_literal: true require "spec_helper" describe WithProductFiles do describe "associations" do context "has many `product_folders`" do it "does not return deleted folders" do product = create(:product) folder_1 = create(:product_folder, link: product) create(:product_f...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/immutable_spec.rb
Ruby
mit
8,966
main
6,396
# frozen_string_literal: true require "spec_helper" describe Immutable do let(:today) { Date.today } # This can be any model, but I'm using the UserComplianceInfo model for the tests. I could not # find a way to create a mock model which included JsonData. let(:model) do build(:user_compliance_info) en...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/external_id_spec.rb
Ruby
mit
8,966
main
1,417
# frozen_string_literal: true require "spec_helper" describe "ExternalId" do before do @purchase = create(:purchase) end describe "#find_by_external_id!" do it "finds the correct object if it exists" do encrypted_id = ObfuscateIds.encrypt(@purchase.id) expect(Purchase.find_by_external_id!(e...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/money_formatter_spec.rb
Ruby
mit
8,966
main
679
# frozen_string_literal: true describe MoneyFormatter do describe "#format" do describe "usd" do it "returns the correct string" do expect(MoneyFormatter.format(400, :usd)).to eq "$4.00" end it "returns correctly when no symbol desired" do expect(MoneyFormatter.format(400, :usd...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/purchase/accounting_spec.rb
Ruby
mit
8,966
main
3,471
# frozen_string_literal: true require "spec_helper" describe Purchase::Accounting do describe "#price_dollars" do it "returns price_cents in dollars" do purchase = create(:purchase) allow(purchase).to receive(:price_cents).and_return(1234) expect(purchase.price_dollars).to eq(12.34) end ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/purchase/risk_spec.rb
Ruby
mit
8,966
main
20,839
# frozen_string_literal: true require "spec_helper" describe Purchase::Risk do before do Feature.activate(:purchase_check_for_fraudulent_ips) end describe "check purchase for previous chargebacks" do it "returns errors if the email has charged-back" do product = create(:product) product_2 =...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/purchase/ping_notification_spec.rb
Ruby
mit
8,966
main
8,341
# frozen_string_literal: true require "spec_helper" describe Purchase::PingNotification, :vcr do describe "#payload_for_ping_notification" do it "contains the correct resource_name" do purchase = create(:purchase, stripe_refunded: true) [ResourceSubscription::SALE_RESOURCE_NAME, ResourceSubscriptio...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/purchase/reviews_spec.rb
Ruby
mit
8,966
main
13,740
# frozen_string_literal: true require "spec_helper" describe Purchase::Reviews do describe "#post_review" do context "non-recurring purchase" do let!(:purchase) { create(:purchase) } context "when there is an existing product_review" do let!(:existing_product_review) { create(:product_revie...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/purchase/targeting_spec.rb
Ruby
mit
8,966
main
9,749
# frozen_string_literal: true require "spec_helper" describe Purchase::Targeting do before do @seller = create(:user) @product = create(:product, user: @seller) @product2 = create(:product, user: @seller) @product3 = create(:product, user: @seller) @purchase1 = create(:purchase, price_cents: 500...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/payment/stats_spec.rb
Ruby
mit
8,966
main
17,452
# frozen_string_literal: true require "spec_helper" describe Payment::Stats, :vcr do describe "revenue_by_link" do before do @user = create(:singaporean_user_with_compliance_info, user_risk_state: "compliant", payment_address: "bob@cat.com") @json = JSON.parse(File.open("#{Rails.root}/spec/support/f...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/balance/searchable_spec.rb
Ruby
mit
8,966
main
213
# frozen_string_literal: true require "spec_helper" describe Balance::Searchable do it "includes ElasticsearchModelAsyncCallbacks" do expect(Balance).to include(ElasticsearchModelAsyncCallbacks) end end
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/shipping_destination/destinations_spec.rb
Ruby
mit
8,966
main
11,888
# frozen_string_literal: true require "spec_helper" describe ShippingDestination::Destinations do describe ".shipping_countries" do it "returns the expected shipping countries" do expect(ShippingDestination::Destinations.shipping_countries).to eq(shipping_countries_expected) end end describe ".eu...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/review_stat_spec.rb
Ruby
mit
8,966
main
11,377
# frozen_string_literal: true require "spec_helper" describe Product::ReviewStat do before do @product = create(:product) end context "when the product_review_stat record exists" do before do purchase_1 = create(:purchase, link: @product) @review_1 = create(:product_review, purchase: purcha...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/creation_limit_spec.rb
Ruby
mit
8,966
main
4,485
# frozen_string_literal: true require "spec_helper" describe Product::CreationLimit, :enforce_product_creation_limit do let(:non_compliant_user) { create(:user, user_risk_state: "not_reviewed") } let(:compliant_user) { create(:user, user_risk_state: "compliant") } context "for non-compliant users" do it "p...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/preview_spec.rb
Ruby
mit
8,966
main
5,594
# frozen_string_literal: true require "spec_helper" def uploaded_file(name) Rack::Test::UploadedFile.new(Rails.root.join("spec", "support", "fixtures", name), MIME::Types.type_for(name).first) end describe Product::Preview do before do @bad_file = uploaded_file("other.garbage") @jpg_file = uploaded_file(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/stats_spec.rb
Ruby
mit
8,966
main
15,663
# frozen_string_literal: true require "spec_helper" describe Product::Stats do include ManageSubscriptionHelpers describe ".successful_sales_count", :sidekiq_inline, :elasticsearch_wait_for_refresh do it "does not take into account refunded/disputed purchases" do @product = create(:product, price_cents...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/prices_spec.rb
Ruby
mit
8,966
main
29,967
# frozen_string_literal: true require "spec_helper" describe Product::Prices do before do @product = create(:product, price_cents: 2_50) @subscription_product = create(:subscription_product, price_cents: 4_00) @subscription_price = @subscription_product.prices.find_by!(recurrence: BasePrice::Recurrence...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/caching_spec.rb
Ruby
mit
8,966
main
13,180
# frozen_string_literal: true require "spec_helper" describe Product::Caching do describe "#invalidate_cache" do before do @product = create(:product) Rails.cache.write(@product.scoped_cache_key("en"), "<html>hello</html>") @product.product_cached_values.create! @other_product = create(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/utils_spec.rb
Ruby
mit
8,966
main
1,258
# frozen_string_literal: true require "spec_helper" describe Product::Utils do describe ".f" do it "fetches product from unique permalink" do product = create(:product) expect(Link.f(product.unique_permalink)).to eq(product) end it "fetches product from custom permalink" do product =...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/recommendations_spec.rb
Ruby
mit
8,966
main
4,340
# frozen_string_literal: true require "spec_helper" describe Product::Recommendations, :elasticsearch_wait_for_refresh do before do @product = create(:product, user: create(:compliant_user, name: "Some creator person"), taxonomy: create(:taxonomy)) end it "is true if has recent sale" do create(:purchas...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/searchable/offer_codes_spec.rb
Ruby
mit
8,966
main
3,494
# frozen_string_literal: true require "spec_helper" describe "Product::Searchable - Offer codes filtering" do describe "filtering by offer_codes", :elasticsearch_wait_for_refresh do before do Link.__elasticsearch__.create_index!(force: true) Feature.activate(:offer_codes_search) @creator = c...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/searchable/indexing_spec.rb
Ruby
mit
8,966
main
14,136
# frozen_string_literal: true require "spec_helper" describe "Product::Searchable - Indexing scenarios" do before do @product = create(:product_with_files) end describe "#as_indexed_json" do it "includes all properties" do taxonomy = create(:taxonomy) @product.update!(name: "Searching for R...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/searchable/search_spec.rb
Ruby
mit
8,966
main
26,570
# frozen_string_literal: true require "spec_helper" describe "Product::Searchable - Search scenarios" do before do @product = create(:product_with_files) end describe "Elasticsearch `search`" do describe "on indexed products with price values" do before do @creator = create(:recommendable...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/searchable/name_field_search_spec.rb
Ruby
mit
8,966
main
4,273
# frozen_string_literal: true require "spec_helper" describe "Product::Searchable - Name fields search scenarios" do before do @product = create(:product_with_files) end describe "on name fields for all products", :elasticsearch_wait_for_refresh do before do Link.__elasticsearch__.create_index!(f...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/product/searchable/filtered_search_spec.rb
Ruby
mit
8,966
main
1,616
# frozen_string_literal: true require "spec_helper" describe "Product::Searchable - Filtered search scenarios" do describe "filters adult products for recommendable products" do before do @creator = create(:recommendable_user, username: "a" + SecureRandom.random_number(1e15).round.to_s, name: "Gumbot") ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/payout_schedule_spec.rb
Ruby
mit
8,966
main
5,947
# frozen_string_literal: true require "spec_helper" describe User::PayoutSchedule do describe "#next_payout_date" do let(:user) { create(:user, payment_address: "bob1@example.com") } context "when payout frequency is weekly" do it "returns the correct next payout date" do travel_to(Date.new(2...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/compliance_spec.rb
Ruby
mit
8,966
main
30,685
# frozen_string_literal: true require "spec_helper" describe User::Compliance do describe "native_payouts_supported?" do it "returns true for US, CA, AU, and UK creators" do %w(US CA AU GB).each do |country_code| creator = create(:user) create(:user_compliance_info_empty, user: creator, co...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/tier_spec.rb
Ruby
mit
8,966
main
3,458
# frozen_string_literal: true require "spec_helper" describe User::Tier do describe "tier state machine" do it "upgrades to next tier" do user = create(:user) expect(user.tier).to eq(User::TIER_0) expect(user.upgrade_tier).to eq(true) expect(user.tier).to eq(User::TIER_1) end it...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/money_balance_spec.rb
Ruby
mit
8,966
main
17,199
# frozen_string_literal: true require "spec_helper" describe User::MoneyBalance do before :each do @user = create(:user) end describe "#unpaid_balance_cents" do context "via SQL" do it "returns sum of unpaid balance in cents" do create(:balance, user: @user, amount_cents: 100, state: "unp...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/ping_notification_spec.rb
Ruby
mit
8,966
main
5,954
# frozen_string_literal: true require "spec_helper" describe User::PingNotification do describe "#send_test_ping" do before do @user = create(:user) @purchase = create(:purchase, seller: @user, link: create(:product, user: @user)) @ping_params = @purchase.payload_for_ping_notification.merge(te...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/devise_internal_spec.rb
Ruby
mit
8,966
main
622
# frozen_string_literal: true require "spec_helper" describe User::DeviseInternal do before do @user = create(:user, confirmed_at: nil) end describe "#confirmation_required?" do it "returns true if email is required" do allow(@user).to receive(:email_required?).and_return(true) allow(@user)...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/australian_backtaxes_spec.rb
Ruby
mit
8,966
main
1,421
# frozen_string_literal: true require "spec_helper" describe User::AustralianBacktaxes do before :each do @creator = create(:user) end describe "#opted_in_to_australia_backtaxes?" do it "returns false if the creator hasn't opted in" do expect(@creator.opted_in_to_australia_backtaxes?).to eq(false...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/posts_spec.rb
Ruby
mit
8,966
main
19,268
# frozen_string_literal: true require "spec_helper" describe User::Posts, :freeze_time do describe "visible_posts_for", :vcr do before do @creator = create(:named_user) product = create(:product, name: "product name", user: @creator) product_2 = create(:product, name: "product 2 name", user: @...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/async_devise_notification_spec.rb
Ruby
mit
8,966
main
1,119
# frozen_string_literal: true require "spec_helper" describe User::AsyncDeviseNotification do include ActiveJob::TestHelper # The methods in this module are private/protected so they aren't tested. # Instead, the methods which they affect are tested. let(:user) { create(:user) } shared_examples_for "an e...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/risk_spec.rb
Ruby
mit
8,966
main
3,315
# frozen_string_literal: true require "spec_helper" describe User::Risk do describe "#disable_refunds!" do before do @creator = create(:user) end it "disables refunds for the creator" do @creator.disable_refunds! expect(@creator.reload.refunds_disabled?).to eq(true) end end d...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/feature_status_spec.rb
Ruby
mit
8,966
main
18,505
# frozen_string_literal: true require "spec_helper" describe User::FeatureStatus do describe "#merchant_migration_enabled?" do it "returns true if either feature flag is enabled of else false" do creator = create(:user) create(:user_compliance_info, user: creator) expect(creator.merchant_migr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/payment_stats_spec.rb
Ruby
mit
8,966
main
5,967
# frozen_string_literal: true require "spec_helper" describe User::Stats do let(:user) { create(:user) } let(:link) { create(:product, user:) } describe "average_transaction_amount_cents" do describe "no sales" do it "returns zero" do expect(user.average_transaction_amount_cents).to eq(0) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/social_google_spec.rb
Ruby
mit
8,966
main
7,348
# frozen_string_literal: true require "spec_helper" describe User::SocialGoogle do before(:all) do @data = JSON.parse(File.open("#{Rails.root}/spec/support/fixtures/google_omniauth.json").read) end describe ".find_or_create_for_google_oauth2" do before do @data_copy1 = @data.deep_dup @data_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/stats_spec.rb
Ruby
mit
8,966
main
68,331
# frozen_string_literal: true require "spec_helper" describe User::Stats, :vcr do before do @user = create(:user, timezone: "London") end describe "#rank" do let(:year) { 2024 } let(:response) { OpenStruct.new(aggregations: OpenStruct.new(sellers: OpenStruct.new(buckets: buckets))) } let(:bucke...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/user/recommendations_spec.rb
Ruby
mit
8,966
main
2,248
# frozen_string_literal: true require "spec_helper" describe Product::Recommendations, :elasticsearch_wait_for_refresh do context "when user is recommendable" do let(:user) { create(:recommendable_user) } it "is recommendable" do expect(user.recommendable_reasons.values).to all(be true) expect(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/subscription/restartable_spec.rb
Ruby
mit
8,966
main
10,614
# frozen_string_literal: true require "spec_helper" describe Subscription::Restartable, :sidekiq_inline do let(:seller) { create(:user) } let(:product) { create(:membership_product, user: seller) } let(:buyer) { create(:user) } # Helper to create a subscription with a proper original purchase def create_su...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/modules/subscription/ping_notification_spec.rb
Ruby
mit
8,966
main
8,704
# frozen_string_literal: true require "spec_helper" describe Subscription::PingNotification do describe "#payload_for_ping_notification" do let(:purchase) { create(:membership_purchase) } let(:subscription) { purchase.subscription } it "contains subscription details" do params = subscription.payl...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/serbia_bank_account_spec.rb
Ruby
mit
8,966
main
2,201
# frozen_string_literal: true describe SerbiaBankAccount do describe "#bank_account_type" do it "returns Serbia" do expect(create(:serbia_bank_account).bank_account_type).to eq("RS") end end describe "#country" do it "returns RS" do expect(create(:serbia_bank_account).country).to eq("RS"...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/price_spec.rb
Ruby
mit
8,966
main
2,891
# frozen_string_literal: true require "spec_helper" describe Price do it "belongs to a link" do price = create(:price) expect(price.link).to be_a Link end it "validates presence of the link" do invalid_price = create(:price) invalid_price.link = nil expect(invalid_price).not_to be_valid ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/malaysia_bank_account_spec.rb
Ruby
mit
8,966
main
2,272
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/black_recurring_service_spec.rb
Ruby
mit
8,966
main
476
# 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") @mail_double = double allow(@mail_double).to receive(:deliver_later) end it "...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/early_fraud_warning_spec.rb
Ruby
mit
8,966
main
13,680
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/guatemala_bank_account_spec.rb
Ruby
mit
8,966
main
1,367
# frozen_string_literal: true require "spec_helper" describe GuatemalaBankAccount do describe "#bank_account_type" do it "returns GT" do expect(create(:guatemala_bank_account).bank_account_type).to eq("GT") end end describe "#country" do it "returns GT" do expect(create(:guatemala_bank_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/audience_member_spec.rb
Ruby
mit
8,966
main
17,257
# frozen_string_literal: true require "spec_helper" RSpec.describe AudienceMember, :freeze_time do describe "validations" do it "validates json schema" do member = build(:audience_member, details: { "foo" => "bar" }) expect(member).to be_invalid expect(member.errors[:details]).to be_present ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/scheduled_payout_spec.rb
Ruby
mit
8,966
main
12,577
# frozen_string_literal: true require "spec_helper" describe ScheduledPayout do describe "validations" do it "is valid with valid attributes" do scheduled_payout = build(:scheduled_payout) expect(scheduled_payout).to be_valid end it "requires an action" do scheduled_payout = build(:sc...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/madagascar_bank_account_spec.rb
Ruby
mit
8,966
main
1,956
# frozen_string_literal: true describe MadagascarBankAccount do describe "#bank_account_type" do it "returns Madagascar" do expect(create(:madagascar_bank_account).bank_account_type).to eq("MG") end end describe "#country" do it "returns MG" do expect(create(:madagascar_bank_account).cou...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/custom_domain_spec.rb
Ruby
mit
8,966
main
16,384
# frozen_string_literal: true require "spec_helper" describe CustomDomain do describe "#validate_domain_format" do context "with a valid domain name" do before do @valid_domains = ["example.com", "example-store2.com", "test.example.com", "test-store.example.com"] end it "saves the doma...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/monaco_bank_account_spec.rb
Ruby
mit
8,966
main
687
# 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") ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/south_africa_bank_account_spec.rb
Ruby
mit
8,966
main
1,392
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/cambodia_bank_account_spec.rb
Ruby
mit
8,966
main
2,153
# frozen_string_literal: true require "spec_helper" describe CambodiaBankAccount do describe "#bank_account_type" do it "returns KH" do expect(create(:cambodia_bank_account).bank_account_type).to eq("KH") end end describe "#country" do it "returns KH" do expect(create(:cambodia_bank_acc...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/seller_profile_wishlists_section_spec.rb
Ruby
mit
8,966
main
1,056
# frozen_string_literal: true require "spec_helper" describe SellerProfileWishlistsSection do describe "validations" do it "validates json_data with the correct schema" do section = build(:seller_profile_wishlists_section, shown_wishlists: [create(:wishlist).id]) section.json_data["garbage"] = "shou...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/community_spec.rb
Ruby
mit
8,966
main
1,188
# frozen_string_literal: true require "spec_helper" RSpec.describe Community do subject(:community) { build(:community) } describe "associations" do it { is_expected.to belong_to(:seller).class_name("User") } it { is_expected.to belong_to(:resource) } it { is_expected.to have_many(:community_chat_mes...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/argentina_bank_account_spec.rb
Ruby
mit
8,966
main
2,224
# frozen_string_literal: true require "spec_helper" describe ArgentinaBankAccount do describe "#bank_account_type" do it "returns argentina" do expect(create(:argentina_bank_account).bank_account_type).to eq("AR") end end describe "#country" do it "returns AR" do expect(create(:argentin...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/paraguay_bank_account_spec.rb
Ruby
mit
8,966
main
1,847
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/armenia_bank_account_spec.rb
Ruby
mit
8,966
main
1,810
# frozen_string_literal: true require "spec_helper" describe ArmeniaBankAccount do describe "#bank_account_type" do it "returns AM" do expect(create(:armenia_bank_account).bank_account_type).to eq("AM") end end describe "#country" do it "returns AM" do expect(create(:armenia_bank_accoun...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/email_info_spec.rb
Ruby
mit
8,966
main
1,207
# frozen_string_literal: true require "spec_helper" describe EmailInfo do describe "#unsubscribe_buyer" do let(:purchase) { create(:purchase) } describe "for a Purchase" do let(:email_info) { create(:customer_email_info, email_name: SendgridEventInfo::RECEIPT_MAILER_METHOD, purchase: purchase) } ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/uzbekistan_bank_account_spec.rb
Ruby
mit
8,966
main
1,964
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/poland_bank_account_spec.rb
Ruby
mit
8,966
main
2,188
# frozen_string_literal: true require "spec_helper" describe PolandBankAccount do describe "#bank_account_type" do it "returns poland" do expect(create(:poland_bank_account).bank_account_type).to eq("PL") end end describe "#country" do it "returns PL" do expect(create(:poland_bank_accou...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/charge_spec.rb
Ruby
mit
8,966
main
18,508
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/subtitle_file_spec.rb
Ruby
mit
8,966
main
3,725
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/computed_sales_analytics_day_spec.rb
Ruby
mit
8,966
main
1,641
# frozen_string_literal: true require "spec_helper" RSpec.describe ComputedSalesAnalyticsDay do describe ".read_data_from_keys" do it "returns hash with sorted existing keys and parsed values" do create(:computed_sales_analytics_day, key: "k2", data: { v: 2 }.to_json) create(:computed_sales_analytic...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/new_zealand_bank_account_spec.rb
Ruby
mit
8,966
main
2,016
# frozen_string_literal: true require "spec_helper" describe NewZealandBankAccount do describe "#bank_account_type" do it "returns new zealand" do expect(create(:new_zealand_bank_account).bank_account_type).to eq("NZ") end end describe "#country" do it "returns NZ" do expect(create(:new...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/third_party_analytic_spec.rb
Ruby
mit
8,966
main
7,080
# 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 ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/circle_integration_spec.rb
Ruby
mit
8,966
main
2,188
# frozen_string_literal: true require "spec_helper" describe CircleIntegration do it "creates the correct json details" do integration = create(:circle_integration) CircleIntegration::INTEGRATION_DETAILS.each do |detail| expect(integration.respond_to?(detail)).to eq true end end it "saves det...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/bolivia_bank_account_spec.rb
Ruby
mit
8,966
main
1,917
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/shipment_spec.rb
Ruby
mit
8,966
main
3,437
# frozen_string_literal: true require "spec_helper" describe Shipment do describe "#shipped?" do it "returns false is shipped_at is nil" do expect(create(:shipment).shipped?).to be(false) end it "returns true is shipped_at is present" do expect(create(:shipment, shipped_at: 1.day.ago).shipp...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/subscription_event_spec.rb
Ruby
mit
8,966
main
1,141
# frozen_string_literal: true require "spec_helper" describe SubscriptionEvent do describe "creation" do it "sets the seller" do subscription_event = create(:subscription_event) expect(subscription_event.seller).to eq(subscription_event.subscription.seller) end it "validates the consecutive...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/base_variant_integration_spec.rb
Ruby
mit
8,966
main
3,319
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/upsell_spec.rb
Ruby
mit
8,966
main
9,422
# 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?)...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/uk_bank_account_spec.rb
Ruby
mit
8,966
main
1,598
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/macao_bank_account_spec.rb
Ruby
mit
8,966
main
2,043
# frozen_string_literal: true describe MacaoBankAccount do describe "#bank_account_type" do it "returns MO" do expect(create(:macao_bank_account).bank_account_type).to eq("MO") end end describe "#country" do it "returns MO" do expect(create(:macao_bank_account).country).to eq("MO") e...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/saint_lucia_bank_account_spec.rb
Ruby
mit
8,966
main
2,864
# frozen_string_literal: true describe SaintLuciaBankAccount do describe "#bank_account_type" do it "returns LC" do expect(create(:saint_lucia_bank_account).bank_account_type).to eq("LC") end end describe "#country" do it "returns LC" do expect(create(:saint_lucia_bank_account).country)....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/dispute_spec.rb
Ruby
mit
8,966
main
1,463
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/colombia_bank_account_spec.rb
Ruby
mit
8,966
main
2,560
# frozen_string_literal: true require "spec_helper" describe ColombiaBankAccount do describe "#bank_account_type" do it "returns Colombia" do expect(create(:colombia_bank_account).bank_account_type).to eq("CO") end end describe "#country" do it "returns CO" do expect(create(:colombia_ba...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/large_seller_spec.rb
Ruby
mit
8,966
main
953
# frozen_string_literal: true require "spec_helper" describe LargeSeller do before do @user = create(:user) end describe ".create_if_warranted" do it "doesn't create a record if large seller already exists" do create(:large_seller, user: @user) expect do described_class.create_if_wa...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/collaborator_spec.rb
Ruby
mit
8,966
main
8,832
# frozen_string_literal: true require "spec_helper" describe Collaborator do describe "associations" do it { is_expected.to belong_to(:seller) } end describe "validations" do it { is_expected.to validate_numericality_of(:affiliate_basis_points).is_greater_than_or_equal_to(1_00).is_less_than_or_equal_to...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/korea_bank_account_spec.rb
Ruby
mit
8,966
main
2,644
# frozen_string_literal: true require "spec_helper" describe KoreaBankAccount do describe "#bank_account_type" do it "returns korea" do expect(create(:korea_bank_account).bank_account_type).to eq("KR") end end describe "#country" do it "returns KR" do expect(create(:korea_bank_account)....
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/backtax_agreement_spec.rb
Ruby
mit
8,966
main
522
# frozen_string_literal: true require "spec_helper" describe BacktaxAgreement do describe "validation" do it "is valid with expected parameters" do expect(build(:backtax_agreement)).to be_valid end it "validates the presence of a signature" do expect(build(:backtax_agreement, signature: nil...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/link_spec.rb
Ruby
mit
8,966
main
196,324
# frozen_string_literal: true require "spec_helper" require "shared_examples/max_purchase_count_concern" describe Link, :vcr do include PreorderHelper let(:link) { create(:product) } subject { link } before do @mock_obj = Object.new allow(@mock_obj).to receive(:code).and_return(200) allow(HTTPar...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/rich_content_spec.rb
Ruby
mit
8,966
main
9,593
# frozen_string_literal: true require "spec_helper" describe RichContent do describe "validations" do describe "description" do context "invalid descriptions" do let(:invalid_descriptions) { ["not valid", ["also not valid"], [{ "type" => 2 }]] } it "adds error when the description is inva...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/mailer_info_spec.rb
Ruby
mit
8,966
main
3,072
# frozen_string_literal: true require "spec_helper" RSpec.describe MailerInfo do describe ".header_name" do it "formats valid header names" do expect(described_class.header_name(:email_provider)).to eq("X-GUM-Email-Provider") expect(described_class.header_name(:mailer_class)).to eq("X-GUM-Mailer-Cla...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/purchase_refund_policy_spec.rb
Ruby
mit
8,966
main
6,651
# frozen_string_literal: true require "spec_helper" describe PurchaseRefundPolicy do it { is_expected.to have_one(:link).through(:purchase) } it { is_expected.to have_one(:product_refund_policy).through(:link) } describe "validations" do it "validates presence" do refund_policy = PurchaseRefundPolicy...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/benin_bank_account_spec.rb
Ruby
mit
8,966
main
2,098
# 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...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/models/bundle_product_purchase_spec.rb
Ruby
mit
8,966
main
1,271
# frozen_string_literal: true require "spec_helper" describe BundleProductPurchase do describe "validations" do let(:bundle_product_purchase) { create(:bundle_product_purchase) } context "bundle product purchase is valid" do it "doesn't add an error" do expect(bundle_product_purchase).to be_v...