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/requests/purchases/product/call_spec.rb | Ruby | mit | 8,966 | main | 4,375 | # frozen_string_literal: true
require "spec_helper"
describe "Call", type: :system, js: true do
let!(:seller) { create(:named_seller, :eligible_for_service_products) }
let!(:call) do
create(
:call_product,
:available_for_a_year,
name: "Call me!",
description: "Call me for business advi... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/installment_plan_price_protection_spec.rb | Ruby | mit | 8,966 | main | 3,154 | # frozen_string_literal: true
require "spec_helper"
describe "Installment plan price protection" do
let(:seller) { create(:user) }
let(:product) { create(:product, user: seller, price_cents: 14700) }
let(:installment_plan) { create(:product_installment_plan, link: product, number_of_installments: 3, recurrence:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/coffee_spec.rb | Ruby | mit | 8,966 | main | 4,542 | # frozen_string_literal: true
require "spec_helper"
describe "Coffee", type: :system, js: true do
let(:seller) { create(:named_seller, :eligible_for_service_products) }
let(:coffee) do
create(
:product,
name: "Buy me a coffee!",
description: "Please give me money. Pretty please! I really nee... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/payment_errors_spec.rb | Ruby | mit | 8,966 | main | 4,991 | # frozen_string_literal: true
require("spec_helper")
describe("Purchase from a product page", type: :system, js: true) do
before do
@creator = create(:named_user)
@product = create(:product, user: @creator)
end
it "displays card expired error if input card is expired as per stripe" do
visit "/l/#{@... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/rentals_spec.rb | Ruby | mit | 8,966 | main | 7,576 | # frozen_string_literal: true
require("spec_helper")
describe("Rentals from product page", type: :system, js: true) do
describe "rentals" do
before do
@product = create(:product_with_video_file, purchase_type: :buy_and_rent, price_cents: 500, rental_price_cents: 200, name: "rental test")
end
it "... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/generate_invoice_spec.rb | Ruby | mit | 8,966 | main | 41,237 | # frozen_string_literal: true
require("spec_helper")
describe("Generate invoice for purchase", type: :system, js: true) do
context "when purchasing from a product page" do
before do
@product = create(:product)
@product2 = create(:product)
end
it "shows a link to generate invoice" do
v... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/legacy_cards_spec.rb | Ruby | mit | 8,966 | main | 2,368 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
# In March 2021 we migrated from Stripe's Charges API to Payment Intents API.
# Many customers have stored their credit cards on file using the old Charges API (via a credit card token).
# This spec ensures that those legacy credit cards keep work... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/invalid_offer_codes_spec.rb | Ruby | mit | 8,966 | main | 2,955 | # frozen_string_literal: true
require("spec_helper")
describe("Invalid offer-code usage from product page", type: :system, js: true) do
describe "manually entered" do
it "shows an error message when entering an invalid offer code and prevents purchase" do
product = create(:product, price_cents: 300, user:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/installment_plan_spec.rb | Ruby | mit | 8,966 | main | 24,205 | # frozen_string_literal: true
require "spec_helper"
describe "Product with installment plan", type: :system, js: true do
let!(:seller) { create(:user, tipping_enabled: true) }
let!(:product) { create(:product, name: "Awesome product", user: seller, price_cents: 1000) }
let!(:installment_plan) { create(:product_... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/offer_codes_with_zero_discount_spec.rb | Ruby | mit | 8,966 | main | 2,377 | # frozen_string_literal: true
require("spec_helper")
describe("Zero-discount offer-code usage from product page", type: :system, js: true) do
context "manually set" do
it "does not error when entering a $0 offer code and allows purchase" do
product = create(:product, price_cents: 300, user: create(:user, ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/quantities_spec.rb | Ruby | mit | 8,966 | main | 3,744 | # frozen_string_literal: true
require("spec_helper")
describe("Multiple quantity purchases from product page", type: :system, js: true) do
describe "multiple quantities", :mock_easypost do
before do
@product = create(:physical_product, price_cents: 200)
end
it "charges the correct amount for PWYW... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/stripejs_purchase_spec.rb | Ruby | mit | 8,966 | main | 6,956 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("PurchaseScenario using StripeJs", type: :system, js: true) do
it "uses a users saved cc if they have one" do
previous_successful_sales_count = Purchase.successful.count
link = create(:product, price_cents: 200)
user = creat... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/default_discount_code_spec.rb | Ruby | mit | 8,966 | main | 2,231 | # frozen_string_literal: true
require("spec_helper")
describe("Default discount code usage from product page", type: :system, js: true) do
let(:seller) { create(:user, display_offer_code_field: true) }
let(:product) { create(:product_with_pdf_file, user: seller, price_cents: 1000) }
let(:default_offer_code) do
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/signup_after_purchase_spec.rb | Ruby | mit | 8,966 | main | 3,292 | # frozen_string_literal: true
require "spec_helper"
describe "Sign up after purchase", type: :system, js: true do
before do
product = create(:product)
product2 = create(:product)
visit product.long_url
add_to_cart(product)
visit product2.long_url
add_to_cart(product2)
product2.update(pri... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/subscription_purchases_spec.rb | Ruby | mit | 8,966 | main | 15,441 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Subscription Purchases from the product page", type: :system, js: true) do
context "purchasing memberships with multiple tiers" do
before do
@membership_product = create(:membership_product_with_preset_tiered_pricing)
t... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/custom_fields_spec.rb | Ruby | mit | 8,966 | main | 5,703 | # frozen_string_literal: true
require("spec_helper")
describe("Product checkout - custom fields", type: :system, js: true) do
before do
@product = create(:product)
end
it "prefills custom fields from query params, except for terms acceptance" do
@product.custom_fields << [
create(:custom_field, t... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/upsell_spec.rb | Ruby | mit | 8,966 | main | 28,316 | # frozen_string_literal: true
require("spec_helper")
describe("Product checkout with upsells", type: :system, js: true) do
let(:seller) { create(:named_seller) }
let(:upsell_product) { create(:product_with_digital_versions, name: "Upsell product", user: seller) }
let!(:upsell) { create(:upsell, text: "Upsell",... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/gift_purchases_spec.rb | Ruby | mit | 8,966 | main | 2,279 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Gift purchases from the product page", type: :system, js: true) do
before do
@user = create(:named_user)
@product = create(:product, user: @user, custom_receipt: "<h1>Hello</h1>")
end
describe "gift purchases" do
let(:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/pending_collaborators_spec.rb | Ruby | mit | 8,966 | main | 1,160 | # frozen_string_literal: true
require("spec_helper")
describe("Product checkout - with pending collaborators", type: :system, js: true) do
let(:product) { create(:product, :recommendable, price_cents: 20_00) }
let!(:pending_collaborator) do
create(
:collaborator,
:with_pending_invitation,
a... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/subscription_payment_options_spec.rb | Ruby | mit | 8,966 | main | 3,649 | # frozen_string_literal: true
require("spec_helper")
describe("Purchasing a multi-recurrence subscription product from product page", type: :system, js: true) do
before do
@product = create(:subscription_product_with_versions, price_cents: 10_00)
@price_yearly = create(:price, link: @product, price_cents: 7... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/offer_codes_tiered_membership_spec.rb | Ruby | mit | 8,966 | main | 2,415 | # frozen_string_literal: true
require("spec_helper")
describe("Offer-code usage from product page for tiered membership", type: :system, js: true) do
let(:product) { create(:membership_product_with_preset_tiered_pricing, user: create(:user, display_offer_code_field: true)) }
let!(:offer_code) { create(:offer_code... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/purchasing_power_parity_spec.rb | Ruby | mit | 8,966 | main | 18,490 | # frozen_string_literal: true
require("spec_helper")
describe "Purchasing power parity", type: :system, js: true do
before do
@user = create(:user, purchasing_power_parity_enabled: true, display_offer_code_field: true)
@product = create(:product, price_cents: 999, user: @user)
@membership = create(:memb... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/recommendations_spec.rb | Ruby | mit | 8,966 | main | 11,927 | # frozen_string_literal: true
require "spec_helper"
describe "RecommendationsScenario", type: :system, js: true do
before do
@original_product = create(:product)
@recommended_product = create(:product,
user: create(:named_user),
preview_url... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/payment_blurb_spec.rb | Ruby | mit | 8,966 | main | 1,872 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Payment Blurb for Purchases from the product page", type: :system, js: true) do
before do
@user = create(:user)
$currency_namespace = Redis::Namespace.new(:currencies, redis: $redis)
$currency_namespace.set("GBP", 0.2)
e... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/offer_codes_spec.rb | Ruby | mit | 8,966 | main | 23,919 | # frozen_string_literal: true
require("spec_helper")
describe("Offer-code usage from product page", type: :system, js: true) do
it "accepts an offer code that's larger than the price of the product" do
product = create(:product, price_cents: 300)
offer_code = create(:offer_code, products: [product], amount_... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/taxes_spec.rb | Ruby | mit | 8,966 | main | 167,053 | # frozen_string_literal: true
require("spec_helper")
describe("Product Page - Tax Scenarios", type: :system, js: true) do
def set_zip_code_via_js(zip_code)
zip_field = find_field("ZIP code")
page.execute_script(<<~JS, zip_field)
var el = arguments[0];
var setter = Object.getOwnPropertyDescriptor... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/purchase/purchase_spec.rb | Ruby | mit | 8,966 | main | 26,095 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Purchases from the product page", type: :system, js: true) do
before do
@user = create(:named_user)
@product = create(:product, user: @user, custom_receipt: "<h1>Hello</h1>")
end
it "shows quantity selector only when quant... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/purchase/purchase_variants_spec.rb | Ruby | mit | 8,966 | main | 2,815 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Variant Purchases from product page", type: :system, js: true) do
before do
@user = create(:named_user)
@product = create(:product, user: @user, custom_receipt: "<h1>Hello</h1>")
end
it "initializes variants from legacy qu... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/shipping/shipping_offer_codes_spec.rb | Ruby | mit | 8,966 | main | 4,788 | # frozen_string_literal: true
describe("Product Page - Shipping with offer codes", type: :system, js: true, shipping: true, force_vcr_on: true) do
before do
# Pin GBP exchange rate to avoid flakiness from currency fluctuations.
# Rate 0.652578 gives: 100 GBP = $153.24 USD, shipping 20 GBP = $30.65 USD
cu... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/shipping/shipping_address_verification_spec.rb | Ruby | mit | 8,966 | main | 10,061 | # frozen_string_literal: true
describe("Product Page - Shipping Scenarios Address verification", type: :system, js: true) do
describe "US address" do
before do
@user = create(:user)
@product = create(:physical_product, user: @user, require_shipping: true, price_cents: 100_00)
@product.shipping_... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/shipping/shipping_physical_subscription_spec.rb | Ruby | mit | 8,966 | main | 4,096 | # frozen_string_literal: true
describe("Product Page - Shipping physical subscription", type: :system, js: true, shipping: true, force_vcr_on: true) do
before do
MerchantAccount.find_or_create_by!(user_id: nil, charge_processor_id: StripeChargeProcessor.charge_processor_id) do |ma|
ma.charge_processor_aliv... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/shipping/shipping_to_virtual_countries_spec.rb | Ruby | mit | 8,966 | main | 1,886 | # frozen_string_literal: true
describe("Product Page - Shipping to Virtual Countries", type: :system, js: true, shipping: true, force_vcr_on: true) do
it "does not show the blurb if there is shipping, but no tax" do
@product = create(:product, user: create(:user), require_shipping: true, price_cents: 100_00)
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/shipping/shipping_spec.rb | Ruby | mit | 8,966 | main | 6,905 | # frozen_string_literal: true
describe("Product Page - Shipping Scenarios", type: :system, js: true, shipping: true, force_vcr_on: true) do
before do
# Pin exchange rates to avoid flakiness from currency fluctuations.
# GBP rate 0.652578 gives: 100 GBP = $153.24 USD, shipping 20 GBP = $30.65 USD
# JPY ra... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/shipping/shipping_physical_preorder_spec.rb | Ruby | mit | 8,966 | main | 6,867 | # frozen_string_literal: true
describe("Product Page - Shipping physical preoder", type: :system, js: true, shipping: true, force_vcr_on: true) do
before do
@creator = create(:user_with_compliance_info)
@product = create(:physical_product, user: @creator, name: "physical preorder", price_cents: 16_00, requir... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/sca/indian_card_mandates_spec.rb | Ruby | mit | 8,966 | main | 7,518 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Successful purchases from a product page with SCA and mandate creation for Indian cards", type: :system, js: true) do
let(:creator) { create(:named_user) }
let(:product) { create(:product, user: creator) }
let(:membership_product) ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/sca/sca_spec.rb | Ruby | mit | 8,966 | main | 2,271 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Purchase from a product page with SCA (Strong Customer Authentication)", type: :system, js: true) do
before do
MerchantAccount.find_or_create_by!(user_id: nil, charge_processor_id: StripeChargeProcessor.charge_processor_id) do |ma|... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/purchases/product/sca/sca_success_spec.rb | Ruby | mit | 8,966 | main | 2,286 | # frozen_string_literal: true
require("spec_helper")
require "timeout"
describe("Successful purchases from a product page with SCA (Strong Customer Authentication)", type: :system, js: true) do
before do
@creator = create(:named_user)
@product = create(:product, user: @creator)
end
context "as a guest ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/emails/list_spec.rb | Ruby | mit | 8,966 | main | 18,397 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe("Email List", :js, :sidekiq_inline, :elasticsearch_wait_for_refresh, type: :system) do
describe "emails" do
let(:seller) { create(:named_seller, timezone: "UTC") }
let(:buyer) { create(:user) }
let(:p... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/emails/create_spec.rb | Ruby | mit | 8,966 | main | 40,647 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe("Email Creation Flow", :js, type: :system) do
include EmailHelpers
let(:seller) { create(:named_seller) }
before do
allow_any_instance_of(User).to receive(:sales_cents_total).and_return(Installment::MIN... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/emails/edit_spec.rb | Ruby | mit | 8,966 | main | 26,326 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe("Email Editing Flow", :js, :elasticsearch_wait_for_refresh, type: :system) do
include EmailHelpers
let(:seller) { create(:named_seller) }
let(:product) { create(:product, name: "Sample product", user: seller... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/bundles/show_spec.rb | Ruby | mit | 8,966 | main | 2,896 | # frozen_string_literal: true
require "spec_helper"
describe("Bundle page", type: :system, js: true) do
let(:seller) { create(:named_seller) }
let(:bundle) { create(:product, user: seller, is_bundle: true, price_cents: 1000) }
let(:product) { create(:product, user: seller, name: "Product", price_cents: 500) }
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/bundles/edit_spec.rb | Ruby | mit | 8,966 | main | 24,075 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "shared_examples/creator_dashboard_page"
describe("Bundle edit page", type: :system, js: true) do
let(:seller) { create(:named_seller) }
let(:bundle) { create(:product, :bundle, user: seller, price_cents: 200) }... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/settings/main_spec.rb | Ruby | mit | 8,966 | main | 12,106 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe("Main Settings Scenario", type: :system, js: true) do
let(:user) { create(:user, name: "Gum") }
before do
login_as user
end
describe "sub navigation" do
it "displays main, profile, payments, passw... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/settings/team_spec.rb | Ruby | mit | 8,966 | main | 5,990 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe("Settings > Team Scenario", type: :system, js: true) do
let(:seller) { create(:named_seller) }
shared_examples_for "leaves the team" do
it "deletes membership and switches account" do
visit settings_... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/settings/advanced_spec.rb | Ruby | mit | 8,966 | main | 8,692 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe("Advanced Settings Scenario", type: :system, js: true) do
let(:seller) { create(:user, name: "Gum") }
describe "deleting the gumroad account" do
context "when logged user has role admin" do
include_c... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/settings/password_spec.rb | Ruby | mit | 8,966 | main | 6,589 | # frozen_string_literal: true
require "spec_helper"
describe("Password Settings Scenario", type: :system, js: true) do
let(:compromised_password) { "password" }
let(:not_compromised_password) { SecureRandom.hex(24) }
before do
login_as user
end
context "when logged in using social login provider" do
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/settings/payments_account_status_spec.rb | Ruby | mit | 8,966 | main | 3,324 | # frozen_string_literal: true
require "spec_helper"
describe "Settings::Payments account_status", type: :request do
include Devise::Test::IntegrationHelpers
let(:seller) { create(:named_seller) }
before do
create(:user_compliance_info, country: "United States", user: seller)
allow_any_instance_of(User... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/settings/third_party_analytics_spec.rb | Ruby | mit | 8,966 | main | 5,201 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe("Third-party Analytics Settings Scenario", type: :system, js: true) do
let(:seller) { create(:named_seller) }
let!(:snippet) { create(:third_party_analytic, user: seller, name: "Snippet 1") }
include_context... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/settings/billing_spec.rb | Ruby | mit | 8,966 | main | 2,606 | # frozen_string_literal: true
require "spec_helper"
describe("Billing Settings Scenario", type: :system, js: true) do
let(:buyer) { create(:user, name: "Alice") }
before { login_as buyer }
describe "saving billing details" do
it "lets a buyer enter and save their legal business billing details" do
v... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/api/v2/product_rate_limiting_spec.rb | Ruby | mit | 8,966 | main | 4,207 | # frozen_string_literal: true
require "spec_helper"
describe "Product API rate limiting", type: :request do
let(:user) { create(:user) }
let(:oauth_application) { create(:oauth_application, owner: create(:user)) }
let(:token) { create("doorkeeper/access_token", application: oauth_application, resource_owner_id:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/requests/api/v2/files_multipart_spec.rb | Ruby | mit | 8,966 | main | 4,169 | # frozen_string_literal: true
require "spec_helper"
require "net/http"
describe "Files multipart upload" do
let(:user) { create(:user) }
let(:oauth_application) { create(:oauth_application, owner: create(:user)) }
let(:token) { create("doorkeeper/access_token", application: oauth_application, resource_owner_id:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/service_charge_policy_spec.rb | Ruby | mit | 8,966 | main | 1,815 | # frozen_string_literal: true
require "spec_helper"
describe ServiceChargePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { cre... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/subscription_policy_spec.rb | Ruby | mit | 8,966 | main | 2,310 | # frozen_string_literal: true
require "spec_helper"
describe SubscriptionPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { crea... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/call_policy_spec.rb | Ruby | mit | 8,966 | main | 2,972 | # frozen_string_literal: true
require "spec_helper"
describe CallPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:call) { create(:call) ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/purchase_policy_spec.rb | Ruby | mit | 8,966 | main | 1,738 | # frozen_string_literal: true
require "spec_helper"
describe PurchasePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/imported_customer_policy_spec.rb | Ruby | mit | 8,966 | main | 2,708 | # frozen_string_literal: true
require "spec_helper"
describe ImportedCustomerPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/dropbox_files_policy_spec.rb | Ruby | mit | 8,966 | main | 1,778 | # frozen_string_literal: true
require "spec_helper"
# Products section
#
describe DropboxFilesPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/user_policy_spec.rb | Ruby | mit | 8,966 | main | 4,715 | # frozen_string_literal: true
require "spec_helper"
describe UserPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:name... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/asset_preview_policy_spec.rb | Ruby | mit | 8,966 | main | 1,753 | # frozen_string_literal: true
require "spec_helper"
# Products section
#
describe AssetPreviewPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/product_review_policy_spec.rb | Ruby | mit | 8,966 | main | 2,781 | # frozen_string_literal: true
require "spec_helper"
describe ProductReviewPolicy do
subject { described_class }
let(:seller) { create(:user) }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { cre... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/affiliate_request_policy_spec.rb | Ruby | mit | 8,966 | main | 1,758 | # frozen_string_literal: true
require "spec_helper"
describe AffiliateRequestPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/thumbnail_policy_spec.rb | Ruby | mit | 8,966 | main | 1,786 | # frozen_string_literal: true
require "spec_helper"
# Products section
#
describe ThumbnailPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
l... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/application_policy_spec.rb | Ruby | mit | 8,966 | main | 2,262 | # frozen_string_literal: true
require "spec_helper"
describe ApplicationPolicy do
describe ".allow_anonymous_user_access!" do
it "does not affect other policy classes" do
policy_class_1 = Class.new(ApplicationPolicy)
policy_class_2 = Class.new(ApplicationPolicy)
policy_class_1.allow_anonymous... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/link_policy_spec.rb | Ruby | mit | 8,966 | main | 5,460 | # frozen_string_literal: true
require "spec_helper"
describe LinkPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:name... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/wishlist_policy_spec.rb | Ruby | mit | 8,966 | main | 2,072 | # frozen_string_literal: true
require "spec_helper"
describe WishlistPolicy do
subject { described_class }
let(:seller) { create(:named_seller) }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/analytics_policy_spec.rb | Ruby | mit | 8,966 | main | 1,699 | # frozen_string_literal: true
require "spec_helper"
describe AnalyticsPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/collaborator_invitation_policy_spec.rb | Ruby | mit | 8,966 | main | 1,984 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/policy_examples"
describe CollaboratorInvitationPolicy do
subject { described_class }
let(:seller) { create(:named_seller) }
let(:admin_for_seller) do
create(
:team_membership,
seller: seller,
role: TeamMembersh... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/commission_policy_spec.rb | Ruby | mit | 8,966 | main | 3,109 | # frozen_string_literal: true
require "spec_helper"
describe CommissionPolicy, :vcr do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:commission... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/product_review_response_policy_spec.rb | Ruby | mit | 8,966 | main | 2,841 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/policy_examples"
describe ProductReviewResponsePolicy do
subject { described_class }
let(:seller) { create(:named_seller) }
let(:admin_for_seller) do
create(
:team_membership,
seller: seller,
role: TeamMembershi... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/s3_utility_policy_spec.rb | Ruby | mit | 8,966 | main | 1,874 | # frozen_string_literal: true
require "spec_helper"
# Products section
#
describe S3UtilityPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
l... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/wishlist_product_policy_spec.rb | Ruby | mit | 8,966 | main | 2,205 | # frozen_string_literal: true
require "spec_helper"
describe WishlistProductPolicy do
subject { described_class }
let(:seller) { create(:named_seller) }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_sel... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/instant_payout_policy_spec.rb | Ruby | mit | 8,966 | main | 1,737 | # frozen_string_literal: true
require "spec_helper"
describe InstantPayoutPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { cre... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/installment_policy_spec.rb | Ruby | mit | 8,966 | main | 3,743 | # frozen_string_literal: true
require "spec_helper"
describe InstallmentPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { creat... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/collaborator_policy_spec.rb | Ruby | mit | 8,966 | main | 3,624 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/policy_examples"
describe CollaboratorPolicy do
subject { described_class }
let(:seller) { create(:named_seller) }
let(:admin_for_seller) do
create(
:team_membership,
seller: seller,
role: TeamMembership::ROLE_A... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/product_review_video_policy_spec.rb | Ruby | mit | 8,966 | main | 3,797 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/policy_examples"
describe ProductReviewVideoPolicy do
subject { described_class }
let(:seller) { create(:named_seller) }
let(:admin_for_seller) do
create(
:team_membership,
seller: seller,
role: TeamMembership::... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/utm_link_policy_spec.rb | Ruby | mit | 8,966 | main | 4,951 | # frozen_string_literal: true
require "spec_helper"
describe UtmLinkPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:n... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/balance_policy_spec.rb | Ruby | mit | 8,966 | main | 1,705 | # frozen_string_literal: true
require "spec_helper"
describe BalancePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:n... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/audience_policy_spec.rb | Ruby | mit | 8,966 | main | 1,703 | # frozen_string_literal: true
require "spec_helper"
describe AudiencePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/dashboard_policy_spec.rb | Ruby | mit | 8,966 | main | 1,699 | # frozen_string_literal: true
require "spec_helper"
describe DashboardPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/comment_context_policy_spec.rb | Ruby | mit | 8,966 | main | 16,559 | # frozen_string_literal: true
require "spec_helper"
describe CommentContextPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user, username: "accountantforseller") }
let(:admin_for_seller) { create(:user, username: "adminforseller") }
let(:marketing_for_seller) { create(:user, usern... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/community_chat_message_policy_spec.rb | Ruby | mit | 8,966 | main | 1,874 | # frozen_string_literal: true
require "spec_helper"
describe CommunityChatMessagePolicy do
subject { described_class }
let(:seller) { create(:named_seller) }
let(:buyer) { create(:user) }
let(:other_buyer) { create(:user) }
let(:product) { create(:product, user: seller) }
let!(:community) { create(:commu... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/community_policy_spec.rb | Ruby | mit | 8,966 | main | 7,984 | # frozen_string_literal: true
require "spec_helper"
describe CommunityPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/workflow_policy_spec.rb | Ruby | mit | 8,966 | main | 2,747 | # frozen_string_literal: true
require "spec_helper"
describe WorkflowPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/direct_affiliate_policy_spec.rb | Ruby | mit | 8,966 | main | 2,732 | # frozen_string_literal: true
require "spec_helper"
describe DirectAffiliatePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { c... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/churn_policy_spec.rb | Ruby | mit | 8,966 | main | 2,078 | # frozen_string_literal: true
require "spec_helper"
describe ChurnPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { create(:nam... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/audience/purchase_policy_spec.rb | Ruby | mit | 8,966 | main | 5,886 | # frozen_string_literal: true
require "spec_helper"
describe Audience::PurchasePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/audience/follower_policy_spec.rb | Ruby | mit | 8,966 | main | 2,641 | # frozen_string_literal: true
require "spec_helper"
describe Audience::FollowerPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/checkout/upsell_policy_spec.rb | Ruby | mit | 8,966 | main | 4,763 | # frozen_string_literal: true
require "spec_helper"
describe Checkout::UpsellPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/checkout/offer_code_policy_spec.rb | Ruby | mit | 8,966 | main | 4,845 | # frozen_string_literal: true
require "spec_helper"
describe Checkout::OfferCodePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller)... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/checkout/form_policy_spec.rb | Ruby | mit | 8,966 | main | 2,595 | # frozen_string_literal: true
require "spec_helper"
describe Checkout::FormPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) { cr... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/stripe_account_sessions/user_policy_spec.rb | Ruby | mit | 8,966 | main | 1,714 | # frozen_string_literal: true
require "spec_helper"
describe StripeAccountSessions::UserPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/gumroad_blog/posts_policy_spec.rb | Ruby | mit | 8,966 | main | 5,454 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/policy_examples"
describe GumroadBlog::PostsPolicy do
subject { described_class }
let(:seller) { create(:user) }
let(:another_seller) { create(:user) }
let(:admin_for_seller) do
create(
:team_membership,
seller: sel... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/admin/impersonators/user_policy_spec.rb | Ruby | mit | 8,966 | main | 834 | # frozen_string_literal: true
require "spec_helper"
describe Admin::Impersonators::UserPolicy do
subject { described_class }
let(:user) { create(:user) }
let(:admin_user) { create(:admin_user) }
let(:seller_context) { SellerContext.new(user: admin_user, seller: admin_user) }
permissions :create? do
co... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/admin/charges/charge_policy_spec.rb | Ruby | mit | 8,966 | main | 2,194 | # frozen_string_literal: true
require "spec_helper"
describe Admin::Charges::ChargePolicy, :vcr do
subject { described_class }
let(:admin_user) { create(:admin_user) }
let(:seller_context) { SellerContext.new(user: admin_user, seller: admin_user) }
permissions :refund? do
let(:charge) do
purchase ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/admin/products/staff_picked/link_policy_spec.rb | Ruby | mit | 8,966 | main | 1,798 | # frozen_string_literal: true
require "spec_helper"
describe Admin::Products::StaffPicked::LinkPolicy do
subject { described_class }
let(:admin_user) { create(:admin_user) }
let(:seller_context) { SellerContext.new(user: admin_user, seller: admin_user) }
let(:product) { create(:product, :recommendable) }
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/settings/billing_policy_spec.rb | Ruby | mit | 8,966 | main | 628 | # frozen_string_literal: true
require "spec_helper"
describe Settings::BillingPolicy do
subject { described_class }
let(:owner) { create(:user) }
let(:other_user) { create(:user) }
permissions :show?, :update? do
it "grants access when the viewer is the seller themselves" do
context = SellerContex... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/settings/profile_policy_spec.rb | Ruby | mit | 8,966 | main | 4,971 | # frozen_string_literal: true
require "spec_helper"
describe Settings::ProfilePolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller) {... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/settings/team/team_invitation_policy_spec.rb | Ruby | mit | 8,966 | main | 3,068 | # frozen_string_literal: true
require "spec_helper"
describe Settings::Team::TeamInvitationPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
l... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/settings/team/team_membership_policy_spec.rb | Ruby | mit | 8,966 | main | 2,102 | # frozen_string_literal: true
require "spec_helper"
describe Settings::Team::TeamMembershipPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
l... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/policies/settings/team/user_policy_spec.rb | Ruby | mit | 8,966 | main | 1,327 | # frozen_string_literal: true
require "spec_helper"
describe Settings::Team::UserPolicy do
subject { described_class }
let(:accountant_for_seller) { create(:user) }
let(:admin_for_seller) { create(:user) }
let(:marketing_for_seller) { create(:user) }
let(:support_for_seller) { create(:user) }
let(:seller... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.