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/mailers/service_mailer_spec.rb | Ruby | mit | 8,966 | main | 1,302 | # frozen_string_literal: true
require "spec_helper"
describe ServiceMailer do
before do
@user = create(:user)
@black_recurring_service = create(:black_recurring_service, user: @user)
end
describe "service_charge_receipt" do
it "renders properly" do
service_charge = create(:service_charge, use... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/creator_mailer_spec.rb | Ruby | mit | 8,966 | main | 8,279 | # frozen_string_literal: true
require "spec_helper"
describe CreatorMailer do
describe "#gumroad_day_fee_saved" do
it "includes details of fee saved on Gumroad day" do
seller = create(:user, gumroad_day_timezone: "Mumbai")
create(:purchase,
price_cents: 40620,
link: create(... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/affiliate_mailer_spec.rb | Ruby | mit | 8,966 | main | 24,975 | # frozen_string_literal: true
require "spec_helper"
describe AffiliateMailer do
describe "#notify_affiliate_of_sale" do
let(:seller) { create(:named_user) }
let(:product_name) { "Affiliated Product" }
let(:purchaser_email) { generate(:email) }
shared_examples "notifies affiliate of a sale" do
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/admin_mailer_spec.rb | Ruby | mit | 8,966 | main | 3,275 | # frozen_string_literal: true
require "spec_helper"
describe AdminMailer do
describe "#chargeback_notify" do
context "for a dispute on Purchase" do
let!(:purchase) { create(:purchase) }
let!(:dispute) { create(:dispute_formalized, purchase:) }
let!(:mail) { described_class.chargeback_notify(di... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/invite_mailer_spec.rb | Ruby | mit | 8,966 | main | 1,828 | # frozen_string_literal: true
require "spec_helper"
describe InviteMailer do
describe "receiver_signed_up" do
before do
@user = create(:user)
@invite = create(:invite, sender_id: @user.id)
@invited_user = create(:user, email: @invite.receiver_email)
@invited_user.mark_as_invited(@user.ex... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/customer_low_priority_mailer_spec.rb | Ruby | mit | 8,966 | main | 32,299 | # frozen_string_literal: true
require "spec_helper"
describe CustomerLowPriorityMailer do
describe "subscription_autocancelled" do
context "memberships" do
before do
@product = create(:subscription_product, name: "fan club")
@subscription = create(:subscription, link: @product)
@pu... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/follower_mailer_spec.rb | Ruby | mit | 8,966 | main | 1,453 | # frozen_string_literal: true
require "spec_helper"
describe FollowerMailer do
describe "#confirm_follower" do
let(:followee) { create(:user) }
let(:unconfirmed_follower) { create(:follower, user: followee) }
it "sends email to follower to confirm the follow" do
mail = FollowerMailer.confirm_foll... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/one_off_mailer_spec.rb | Ruby | mit | 8,966 | main | 5,926 | # frozen_string_literal: true
require "spec_helper"
describe OneOffMailer do
let(:email) { "seller@example.com" }
let(:reply_to) { ApplicationMailer::NOREPLY_EMAIL_WITH_NAME }
describe "#email" do
let(:subject) { "Email subject" }
let(:body) { "Email body" }
it "doesn't send attempt to email if bo... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/user_signup_mailer_spec.rb | Ruby | mit | 8,966 | main | 2,738 | # frozen_string_literal: true
require "spec_helper"
describe UserSignupMailer do
it "includes RescueSmtpErrors" do
expect(described_class).to include(RescueSmtpErrors)
end
describe "#confirmation_instructions" do
before do
user = create(:user)
@mail = described_class.confirmation_instructio... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/merchant_registration_mailer_spec.rb | Ruby | mit | 8,966 | main | 4,568 | # frozen_string_literal: true
require "spec_helper"
describe MerchantRegistrationMailer do
describe "#account_deauthorized_to_user" do
let(:user) { create(:user) }
let(:user_id) { user.id }
let(:charge_processor_id) { StripeChargeProcessor.charge_processor_id }
let(:mail) do
described_class.a... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/accounting_mailer_spec.rb | Ruby | mit | 8,966 | main | 5,914 | # frozen_string_literal: true
require "spec_helper"
describe AccountingMailer, :vcr do
describe "#vat_report" do
let(:dummy_s3_link) { "https://test_vat_link.at.s3" }
before do
@mail = AccountingMailer.vat_report(3, 2015, dummy_s3_link)
end
it "has the s3 link in the body" do
expect(@m... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/team_mailer_spec.rb | Ruby | mit | 8,966 | main | 1,539 | # frozen_string_literal: true
require "spec_helper"
describe TeamMailer do
let(:seller) { create(:named_seller) }
describe "#invite" do
let(:email) { "member@example.com" }
let(:team_invitation) { create(:team_invitation, seller:, email:) }
subject(:mail) { described_class.invite(team_invitation) }
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/affiliate_request_mailer_spec.rb | Ruby | mit | 8,966 | main | 6,843 | # frozen_string_literal: true
require "spec_helper"
describe AffiliateRequestMailer do
let(:requester_email) { "requester@example.com" }
let(:creator) { create(:named_user) }
let(:affiliate_request) { create(:affiliate_request, email: requester_email, seller: creator) }
describe "notify_requester_of_request_... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/internal_notification_mailer_spec.rb | Ruby | mit | 8,966 | main | 1,610 | # frozen_string_literal: true
require "spec_helper"
describe InternalNotificationMailer do
describe "#notify" do
subject(:mail) do
described_class.notify(
room_name: "payments",
sender: "VAT Reporting",
message_text: "VAT report generated successfully."
)
end
it "sen... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/customer_mailer_spec.rb | Ruby | mit | 8,966 | main | 58,319 | # frozen_string_literal: true
require "spec_helper"
describe CustomerMailer do
describe "receipt" do
subject(:mail) do
user = create(:user, email: "bob@gumroad.com", name: "bob walsh")
link = create(:product, user:)
@purchase = create(:purchase, link:, seller: link.user, email: "to@example.or... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/community_chat_recap_mailer_spec.rb | Ruby | mit | 8,966 | main | 6,613 | # frozen_string_literal: true
require "spec_helper"
describe CommunityChatRecapMailer do
describe "community_chat_recap_notification" do
let(:user) { create(:user) }
let(:seller) { create(:user, name: "John Doe") }
let(:product) { create(:product, user: seller, name: "Snap app") }
let!(:community) {... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/creator_mailer/top_creator_announcement_spec.rb | Ruby | mit | 8,966 | main | 1,795 | # frozen_string_literal: true
require "spec_helper"
describe CreatorMailer do
describe "#top_creator_announcement" do
it "doesn't send email if user does not exist" do
mail = described_class.top_creator_announcement(user_id: 0)
expect(mail.message).to be_a(ActionMailer::Base::NullMail)
end
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/concerns/custom_mailer_route_builder_spec.rb | Ruby | mit | 8,966 | main | 2,235 | # frozen_string_literal: true
require "spec_helper"
describe CustomMailerRouteBuilder do
let(:mailer_class) do
Class.new(ActionMailer::Base) do
include CustomMailerRouteBuilder
end
end
before do
@mail = mailer_class.new
@user = create(:user, username: "creatordude")
@post = create(:in... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/mailers/concerns/rescue_smtp_errors_spec.rb | Ruby | mit | 8,966 | main | 1,448 | # frozen_string_literal: true
require "spec_helper"
describe RescueSmtpErrors do
let(:mailer_class) do
Class.new(ActionMailer::Base) do
include RescueSmtpErrors
def welcome
# We need a body to not render views
mail(from: "foo@bar.com", body: "")
end
end
end
describe "... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/observers/email_delivery_observer_spec.rb | Ruby | mit | 8,966 | main | 732 | # frozen_string_literal: true
require "spec_helper"
describe EmailDeliveryObserver do
describe ".delivered_email" do
let(:message) { instance_double(Mail::Message) }
before do
allow(EmailDeliveryObserver::HandleEmailEvent).to receive(:perform).with(message).and_return(true)
allow(EmailDeliveryO... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/observers/email_delivery_observer/handle_customer_email_info_spec.rb | Ruby | mit | 8,966 | main | 8,485 | # frozen_string_literal: true
require "spec_helper"
describe EmailDeliveryObserver::HandleCustomerEmailInfo do
let(:purchase) { create(:purchase) }
describe ".perform" do
RSpec.shared_examples "CustomerMailer.receipt" do
describe "for a Purchase" do
context "when CustomerEmailInfo record doesn'... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/observers/email_delivery_observer/handle_email_event_spec.rb | Ruby | mit | 8,966 | main | 831 | # frozen_string_literal: true
require "spec_helper"
describe EmailDeliveryObserver::HandleEmailEvent do
let(:user) { create(:user, email: "user@example.com") }
let(:email_digest) { Digest::SHA1.hexdigest(user.email).first(12) }
describe ".perform" do
it "logs email sent event" do
timestamp = Time.cur... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/imported_customers_controller_spec.rb | Ruby | mit | 8,966 | main | 1,623 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe ImportedCustomersController do
let(:seller) { create(:named_user) }
describe "GET index" do
include_context "with user signed in as admin for seller"
before do
@product = create(:product, user: ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/discover_controller_spec.rb | Ruby | mit | 8,966 | main | 14,420 | # frozen_string_literal: true
require "spec_helper"
require "inertia_rails/rspec"
describe DiscoverController, type: :controller, inertia: true do
let(:discover_domain_with_protocol) { UrlService.discover_domain_with_protocol }
before do
allow_any_instance_of(Link).to receive(:update_asset_preview)
@buye... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/posts_controller_spec.rb | Ruby | mit | 8,966 | main | 16,559 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe PostsController, type: :controller, inertia: true do
let(:seller) { create(:named_seller) }
context "within seller area" do
include_context "with user signed in as admin for s... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/tax_center_controller_spec.rb | Ruby | mit | 8,966 | main | 8,939 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe TaxCenterController, type: :controller, inertia: true do
let(:seller) { create(:user, created_at: 2.years.ago) }
before d... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/stripe_account_sessions_controller_spec.rb | Ruby | mit | 8,966 | main | 2,875 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
RSpec.describe StripeAccountSessionsController do
let(:seller) { create(:named_seller) }
let(:connected_account_id) { "acct_123" }
before do
sign_in(seller)
end
describe "#create" do
it_behaves_like "aut... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/wishlists_controller_spec.rb | Ruby | mit | 8,966 | main | 6,351 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe WishlistsController, type: :controller, inertia: true do
render_views
let(:user) { create(:user) }
let(:wishlist) { create(:wishlist, user:) }
describe "GET index" do
bef... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/two_factor_authentication_controller_spec.rb | Ruby | mit | 8,966 | main | 15,114 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/merge_guest_cart_with_user_cart"
require "inertia_rails/rspec"
describe TwoFactorAuthenticationController, type: :controller, inertia: true do
render_views
include UsersHelper
before do
@user = create(:user, two_factor_authenticat... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/application_controller_spec.rb | Ruby | mit | 8,966 | main | 15,309 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe ApplicationController do
controller do
def index
render plain: "spec"
end
end
def index(p = {})
get :index, params: p
end
def stubbed_cookie
calculated_fingerprint = "3dfakl93klfdj... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/checkout_controller_spec.rb | Ruby | mit | 8,966 | main | 22,791 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe CheckoutController, type: :controller, inertia: true do
let!(:seller) { create(:named_seller) }
describe "GET show" do
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/robots_controller_spec.rb | Ruby | mit | 8,966 | main | 977 | # frozen_string_literal: true
require "spec_helper"
describe RobotsController do
render_views
describe "GET index" do
before do
@sitemap_config = "Sitemap: https://example.com/sitemap.xml"
@user_agent_rules = ["User-agent: *", "Disallow: /purchases/"]
robots_service = instance_double(Robot... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/product_duplicates_controller_spec.rb | Ruby | mit | 8,966 | main | 4,853 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe ProductDuplicatesController do
it_behaves_like "inherits from Sellers::BaseController"
let(:seller) { create(:named_seller) }
let(:product) { create(... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/orders_controller_spec.rb | Ruby | mit | 8,966 | main | 105,448 | # frozen_string_literal: false
require "spec_helper"
require "shared_examples/authorize_called"
include CurrencyHelper
describe OrdersController, :vcr do
before do
cookies[:_gumroad_guid] = SecureRandom.uuid
MerchantAccount.find_or_create_by!(user_id: nil, charge_processor_id: StripeChargeProcessor.charge_... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/tags_controller_spec.rb | Ruby | mit | 8,966 | main | 1,188 | # frozen_string_literal: true
require "spec_helper"
describe TagsController do
describe "List tags" do
it "Shows matching tags alphabetically" do
%w[Armadillo Antelope Marmoset Aardvark].each { |animal| create(:tag, name: animal) }
get(:index, params: { text: "a" })
expect(response.parsed_body... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/customer_surcharge_controller_spec.rb | Ruby | mit | 8,966 | main | 6,288 | # frozen_string_literal: true
require "spec_helper"
describe CustomerSurchargeController, :vcr do
include ManageSubscriptionHelpers
before do
@user = create(:user)
@product = create(:product, user: @user)
@physical_product = create(:physical_product, user: @user)
country_code = Compliance::Countr... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/careers_controller_spec.rb | Ruby | mit | 8,966 | main | 1,826 | # frozen_string_literal: true
require "spec_helper"
describe CareersController do
render_views
describe "GET index" do
context "when career_pages feature is active" do
before { Feature.activate(:career_pages) }
it "renders successfully" do
get :index
expect(response).to be_succe... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/third_party_analytics_controller_spec.rb | Ruby | mit | 8,966 | main | 4,846 | # frozen_string_literal: true
require "spec_helper"
describe ThirdPartyAnalyticsController do
render_views
before do
@seller = create(:user)
@product = create(:product, user: @seller)
@purchase = create(:purchase, link: @product)
@product_product_snippet = create(:third_party_analytic, user: @sel... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/confirmations_controller_spec.rb | Ruby | mit | 8,966 | main | 3,178 | # frozen_string_literal: true
require "spec_helper"
describe ConfirmationsController do
before do
request.env["devise.mapping"] = Devise.mappings[:user]
@user = create(:user, confirmed_at: nil)
end
describe "#show" do
describe "already confirmed" do
before do
@confirmation_token = @us... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/licenses_controller_spec.rb | Ruby | mit | 8,966 | main | 1,130 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe LicensesController do
it_behaves_like "inherits from Sellers::BaseController"
render_views
let(:seller) { create(:named_seller) }
let(:license) { ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/churn_controller_spec.rb | Ruby | mit | 8,966 | main | 4,269 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe ChurnController, type: :controller, inertia: true do
let(:seller) { create(:named_seller) }
let(:churn_data) { { placeholder: "churn data" } }
let(:service) { instance_double(Cre... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/url_redirects_controller_spec.rb | Ruby | mit | 8,966 | main | 109,563 | # frozen_string_literal: true
require "spec_helper"
require "inertia_rails/rspec"
describe UrlRedirectsController, inertia: true do
render_views
before do
@product = create(:product_with_pdf_file)
@url_redirect = create(:url_redirect, purchase: create(:purchase, email: "abCabC@abc.com", link: @product))
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/library_controller_spec.rb | Ruby | mit | 8,966 | main | 7,344 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe LibraryController, :vcr, type: :controller, inertia: true do
it_behaves_like "inherits from Sellers::BaseController"
let(... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/audience_controller_spec.rb | Ruby | mit | 8,966 | main | 4,232 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe AudienceController, inertia: true do
let(:seller) { create(:named_seller) }
include_context "with user signed in as admin for seller"
describe "GET index" do
it_behaves_lik... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/profile_sections_controller_spec.rb | Ruby | mit | 8,966 | main | 12,834 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe ProfileSectionsController do
let(:seller) { create(:named_seller) }
let(:pundit_user) { SellerContext.new(user: seller, seller:) }
it_behaves_like "a... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/home_controller_spec.rb | Ruby | mit | 8,966 | main | 816 | # frozen_string_literal: true
require "spec_helper"
describe HomeController do
render_views
describe "GET features_md" do
it "returns markdown with the feature list" do
get :features_md
expect(response).to be_successful
expect(response.content_type).to include("text/markdown")
expect... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/consumption_analytics_controller_spec.rb | Ruby | mit | 8,966 | main | 3,266 | # frozen_string_literal: true
require "spec_helper"
describe ConsumptionAnalyticsController do
describe "POST create" do
before do
@purchased_link = create(:product)
@product_file = create(:product_file, link: @purchased_link)
@purchase = create(:purchase, link: @purchased_link, purchase_state... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/commissions_controller_spec.rb | Ruby | mit | 8,966 | main | 3,266 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe CommissionsController, :vcr do
let(:seller) { create(:named_seller, :eligible_for_service_products) }
let(:pundit_user) { SellerContext.new(user: seller... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/s3_utility_controller_spec.rb | Ruby | mit | 8,966 | main | 2,711 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe S3UtilityController do
include CdnUrlHelper
it_behaves_like "inherits from Sellers::BaseController"
let(:seller) { create(:named_seller) }
includ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/links_controller_spec.rb | Ruby | mit | 8,966 | main | 210,000 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/affiliate_cookie_concern"
require "shared_examples/authorize_called"
require "shared_examples/collaborator_access"
require "shared_examples/with_sorting_and_pagination"
require "inertia_rails/rspec"
def e404_test(action)
it "404s when link... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/secure_redirect_controller_spec.rb | Ruby | mit | 8,966 | main | 13,581 | # frozen_string_literal: true
require "spec_helper"
require "inertia_rails/rspec"
describe SecureRedirectController, type: :controller, inertia: true do
let(:destination_url) { user_unsubscribe_url(id: "sample-id", email_type: "notify") }
let(:confirmation_text) { "user@example.com" }
let(:secure_payload) do
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/paypal_controller_spec.rb | Ruby | mit | 8,966 | main | 13,259 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe PaypalController, :vcr do
include AffiliateCookie
let(:window_location) { "https://127.0.0.1:3000/l/test?wanted=true" }
let(:paypal_auth_token) { "Bearer A21AAF5T7EesDXLWLuLRvWyMYLvqXkVxpL_exqSEColXRRl47Bxzj... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/bundles_controller_spec.rb | Ruby | mit | 8,966 | main | 2,930 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe BundlesController, inertia: true do
let(:seller) { create(:named_seller, :eligible_for_service_products) }
let(:bundle) { ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/offer_codes_controller_spec.rb | Ruby | mit | 8,966 | main | 3,853 | # frozen_string_literal: true
require "spec_helper"
describe OfferCodesController do
describe "#compute_discount" do
let(:product) { create(:product, price_cents: 500) }
let(:offer_code) { create(:offer_code, products: [product], max_purchase_count: 2) }
let(:offer_code_params) do
{
code: ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/affiliate_requests_controller_spec.rb | Ruby | mit | 8,966 | main | 15,242 | # frozen_string_literal: true
require "spec_helper"
require "inertia_rails/rspec"
require "shared_examples/authorize_called"
describe AffiliateRequestsController, inertia: true do
describe "GET new" do
context "when the creator doesn't exist" do
it "renders 404 page" do
expect do
get :ne... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/followers_controller_spec.rb | Ruby | mit | 8,966 | main | 10,231 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe FollowersController, inertia: true do
render_views
let(:seller) { create(:named_seller) }
let(:pundit_user) { SellerContext.new(user: seller, seller:) }
context "within selle... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/acme_challenges_controller_spec.rb | Ruby | mit | 8,966 | main | 1,238 | # frozen_string_literal: true
require "spec_helper"
describe AcmeChallengesController do
describe "GET 'show'" do
let(:token) { "a" * 43 }
let(:challenge_content) { "challenge-response-content" }
context "when challenge exists in Redis" do
before do
$redis.set(RedisKey.acme_challenge(toke... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/purchase_custom_fields_controller_spec.rb | Ruby | mit | 8,966 | main | 3,766 | # frozen_string_literal: true
require "spec_helper"
describe PurchaseCustomFieldsController do
describe "POST create" do
let(:user) { create(:user) }
let(:product) { create(:product, user: user) }
let(:purchase) { create(:purchase, link: product) }
let(:custom_field) { create(:custom_field, products... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/utm_link_tracking_controller_spec.rb | Ruby | mit | 8,966 | main | 680 | # frozen_string_literal: true
require "spec_helper"
describe UtmLinkTrackingController do
let(:utm_link) { create(:utm_link) }
before do
Feature.activate_user(:utm_links, utm_link.seller)
end
describe "GET show" do
it "raises error if the :utm_links feature flag is disabled" do
Feature.deactiv... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/instant_payouts_controller_spec.rb | Ruby | mit | 8,966 | main | 1,288 | # frozen_string_literal: true
require "spec_helper"
describe InstantPayoutsController do
let(:seller) { create(:user) }
let(:instant_payouts_service) { instance_double(InstantPayoutsService) }
let(:date) { 1.day.ago.to_date }
before do
sign_in seller
allow(InstantPayoutsService).to receive(:new).with... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/test_pings_controller_spec.rb | Ruby | mit | 8,966 | main | 2,225 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe TestPingsController do
it_behaves_like "inherits from Sellers::BaseController"
let(:seller) { create(:user, notification_endpoint: "http://notification... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/product_reviews_controller_spec.rb | Ruby | mit | 8,966 | main | 11,221 | # frozen_string_literal: true
require "spec_helper"
describe ProductReviewsController do
let(:product) { create(:product) }
let(:purchaser) { create(:user) }
let(:purchase) { create(:purchase, link: product, purchaser: purchaser, created_at: 2.years.ago) }
let(:valid_params) do
{
link_id: product.un... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/github_stars_controller_spec.rb | Ruby | mit | 8,966 | main | 433 | # frozen_string_literal: true
require "spec_helper"
describe GithubStarsController do
describe "GET show", :vcr do
it "renders HTTP success" do
get :show
expect(response).to be_successful
expect(response.content_type).to include("application/json")
expect(response.parsed_body["stars"]).... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/product_review_responses_controller_spec.rb | Ruby | mit | 8,966 | main | 5,160 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe ProductReviewResponsesController do
describe "PUT update" do
let!(:seller) { create(:named_seller) }
let!(:product) { create(:product, user: seller) }
let!(:purchaser) { create(:user) }
let!(:purc... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/signup_controller_spec.rb | Ruby | mit | 8,966 | main | 20,379 | # frozen_string_literal: true
require "spec_helper"
require "inertia_rails/rspec"
describe SignupController, type: :controller, inertia: true do
render_views
before :each do
request.env["devise.mapping"] = Devise.mappings[:user]
end
describe "GET new" do
describe "Sign up and connect to OAuth app" d... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/foreign_webhooks_controller_spec.rb | Ruby | mit | 8,966 | main | 13,545 | # frozen_string_literal: false
require "spec_helper"
describe ForeignWebhooksController do
before do
@query = { some: "data", and: { nested: "data" } }
end
describe "#stripe" do
it "responds successfully to charge.succeeded" do
json = { type: "charge.succeeded", id: "evt_dafasdfadsf", pending_web... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/shipments_controller_spec.rb | Ruby | mit | 8,966 | main | 7,083 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe ShipmentsController, :vcr do
describe "POST verify_shipping_address" do
describe "US address" do
before do
@params = {
street_address: "1640 17th St",
city: "San Francisco",... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/affiliate_redirect_controller_spec.rb | Ruby | mit | 8,966 | main | 4,412 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/affiliate_cookie_concern"
describe AffiliateRedirectController do
let(:creator) { create(:user) }
let(:product) { create(:product, user: creator) }
let(:product_2) { create(:product, user: creator) }
let(:affiliate_user) { create(:af... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/embedded_javascripts_controller_spec.rb | Ruby | mit | 8,966 | main | 663 | # frozen_string_literal: true
require "spec_helper"
describe EmbeddedJavascriptsController do
render_views
describe "overlay" do
it "returns the correct js" do
get :overlay, format: :js
expect(response.body).to match(ActionController::Base.helpers.asset_url(Shakapacker.manifest.lookup!("overlay.j... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/communities_controller_spec.rb | Ruby | mit | 8,966 | main | 7,707 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe CommunitiesController, inertia: true do
render_views
let(:seller) { create(:user) }
let(:pundit_user) { SellerContext.n... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/comments_controller_spec.rb | Ruby | mit | 8,966 | main | 29,030 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe CommentsController do
include ManageSubscriptionHelpers
let(:seller) { create(:named_seller) }
let(:product) { create(:product, user: seller) }
let(:user) { create(:user) }
shared_examples_for "erroneou... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/public_controller_spec.rb | Ruby | mit | 8,966 | main | 5,267 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe PublicController, type: :controller, inertia: true do
render_views
let!(:demo_product) { create(:product, unique_permalink: "demo") }
describe "GET api", inertia: true do
i... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/subscriptions_controller_spec.rb | Ruby | mit | 8,966 | main | 8,776 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe SubscriptionsController do
let(:seller) { create(:named_seller) }
let(:subscriber) { create(:user) }
before do
@product = create(:membership_product, subscription_duration: "monthly", user: seller)
@... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/workflows_controller_spec.rb | Ruby | mit | 8,966 | main | 7,942 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "shared_examples/sellers_base_controller_concern"
require "inertia_rails/rspec"
describe WorkflowsController, type: :controller, inertia: true do
it_behaves_like "inherits from Sellers::BaseController"
let(:sel... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/dropbox_files_controller_spec.rb | Ruby | mit | 8,966 | main | 1,935 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe DropboxFilesController do
it_behaves_like "inherits from Sellers::BaseController"
let(:seller) { create(:named_seller) }
include_context "with user ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/thumbnails_controller_spec.rb | Ruby | mit | 8,966 | main | 8,107 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe ThumbnailsController, :vcr do
it_behaves_like "inherits from Sellers::BaseController"
let(:seller) { create(:named_seller) }
let(:product) { create(:... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/calls_controller_spec.rb | Ruby | mit | 8,966 | main | 1,430 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe CallsController do
let(:seller) { create(:named_seller, :eligible_for_service_products) }
let(:pundit_user) { SellerContext.new(user: seller, seller:) }... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/customers_controller_spec.rb | Ruby | mit | 8,966 | main | 23,427 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe CustomersController, :vcr, type: :controller, inertia: true do
render_views
let(:seller) { create(:named_user) }
include_context "with user signed in as admin for seller"
de... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/healthcheck_controller_spec.rb | Ruby | mit | 8,966 | main | 3,167 | # frozen_string_literal: true
require "spec_helper"
describe HealthcheckController do
describe "GET 'index'" do
it "returns 'healthcheck' as text" do
get :index
expect(response.status).to eq(200)
expect(response.body).to eq("healthcheck")
end
end
SIDEKIQ_QUEUE_NAMES = [:critical, :de... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/users_controller_spec.rb | Ruby | mit | 8,966 | main | 27,196 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe UsersController do
render_views
let(:creator) { create(:user, username: "creator") }
let(:seller) { create(:named_seller) }
describe "GET current_user_data" do
context "w... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/affiliates_controller_spec.rb | Ruby | mit | 8,966 | main | 11,674 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "shared_examples/authentication_required"
require "inertia_rails/rspec"
describe AffiliatesController, type: :controller, inertia: true do
let(:seller) { create(:named_seller) }
let!(:product) { create(:product,... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/dashboard_controller_spec.rb | Ruby | mit | 8,966 | main | 10,427 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe DashboardController, type: :controller, inertia: true do
render_views
it_behaves_like "inherits from Sellers::BaseControl... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/asset_previews_controller_spec.rb | Ruby | mit | 8,966 | main | 3,730 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe AssetPreviewsController do
let(:seller) { create(:named_seller) }
let(:product) { create(:product, user: seller) }
let(:s3_url) { "#{AWS_S3_ENDPOINT}/#{S3_BUCKET}/specs/test.png" }
include_context "with us... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/oauth_completions_controller_spec.rb | Ruby | mit | 8,966 | main | 3,815 | # frozen_string_literal: true
require "spec_helper"
describe OauthCompletionsController, :vcr do
describe "#stripe" do
let(:auth_uid) { "acct_1SOb0DEwFhlcVS6d" }
let(:referer) { settings_payments_path }
let(:user) { create(:user) }
def set_session_data
session[:stripe_connect_data] = {
... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/emails_controller_spec.rb | Ruby | mit | 8,966 | main | 8,158 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "shared_examples/sellers_base_controller_concern"
require "inertia_rails/rspec"
describe EmailsController, type: :controller, inertia: true do
it_behaves_like "inherits from Sellers::BaseController"
render_view... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/media_locations_controller_spec.rb | Ruby | mit | 8,966 | main | 6,185 | # frozen_string_literal: true
require "spec_helper"
describe MediaLocationsController do
describe "POST create" do
before do
@product = create(:product)
@product_file = create(:product_file, link: @product)
@purchase = create(:purchase, link: @product, purchase_state: :successful)
@url_r... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/braintree_controller_spec.rb | Ruby | mit | 8,966 | main | 2,429 | # frozen_string_literal: true
require "spec_helper"
describe BraintreeController, :vcr do
describe "#client_token" do
it "returns client token in json on success" do
get :client_token
response_hash = response.parsed_body
expect(response_hash["clientToken"].present?).to be true
end
it ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/purchases_controller_spec.rb | Ruby | mit | 8,966 | main | 70,240 | # frozen_string_literal: false
require "spec_helper"
require "shared_examples/authorize_called"
require "shared_examples/order_association_with_cart_post_checkout"
include CurrencyHelper
describe PurchasesController, :vcr do
include ManageSubscriptionHelpers
render_views
let(:price) { 600 }
let(:product) {... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/logins_controller_spec.rb | Ruby | mit | 8,966 | main | 14,819 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/merge_guest_cart_with_user_cart"
require "inertia_rails/rspec"
describe LoginsController, type: :controller, inertia: true do
render_views
before :each do
request.env["devise.mapping"] = Devise.mappings[:user]
end
describe "GET... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/analytics_controller_spec.rb | Ruby | mit | 8,966 | main | 7,117 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
describe AnalyticsController do
render_views
let(:seller) { create(:named_seller) }
include_context "with user signed in as admin for seller"
describe "GET index" do
it_behaves_like "authorize called for acti... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/recommended_products_controller_spec.rb | Ruby | mit | 8,966 | main | 2,205 | # frozen_string_literal: true
require "spec_helper"
describe RecommendedProductsController do
describe "GET index" do
let(:recommender_model_name) { RecommendedProductsService::MODEL_SALES }
let(:cart_product) { create(:product) }
let(:products) { create_list(:product, 5) }
let(:products_relation) {... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/support_controller_spec.rb | Ruby | mit | 8,966 | main | 7,602 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe SupportController, inertia: true do
let(:seller) { create(:named_seller) }
describe "GET index" do
context "when user is signed in" do
before { sign_in seller }
i... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/reviews_controller_spec.rb | Ruby | mit | 8,966 | main | 3,116 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe ReviewsController, type: :controller, inertia: true do
let(:user) { create(:user) }
describe "GET index" do
before do
Feature.activate(:reviews_page)
sign_in(user)... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/utm_links_controller_spec.rb | Ruby | mit | 8,966 | main | 16,904 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe UtmLinksController, type: :controller, inertia: true do
let(:seller) { create(:user) }
let(:pundit_user) { SellerContext.n... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/balance_controller_spec.rb | Ruby | mit | 8,966 | main | 4,276 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe BalanceController, type: :controller, inertia: true do
it_behaves_like "inherits from Sellers::BaseController"
let(:selle... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/products/collabs_controller_spec.rb | Ruby | mit | 8,966 | main | 11,686 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
require "inertia_rails/rspec"
describe Products::CollabsController, :vcr, :sidekiq_inline, :elasticsearch_wait_for_refresh, inertia: true do
include CurrencyHelper... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/products/mobile_tracking_controller_spec.rb | Ruby | mit | 8,966 | main | 568 | # frozen_string_literal: true
require "spec_helper"
describe Products::MobileTrackingController do
describe "GET show" do
let(:product) { create(:product) }
it "assigns props for tracking" do
expect(MobileTrackingPresenter).to receive(:new).with(seller: product.user).and_call_original
get :sho... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/products/remaining_call_availabilities_controller_spec.rb | Ruby | mit | 8,966 | main | 1,578 | # frozen_string_literal: true
require "spec_helper"
describe Products::RemainingCallAvailabilitiesController do
describe "GET #index" do
context "when the product is a call product" do
let(:call_product) { create(:call_product) }
let!(:call_availability) { create(:call_availability, call: call_produ... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/products/other_refund_policies_controller_spec.rb | Ruby | mit | 8,966 | main | 1,668 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/sellers_base_controller_concern"
require "shared_examples/authorize_called"
describe Products::OtherRefundPoliciesController do
it_behaves_like "inherits from Sellers::BaseController"
let(:seller) { create(:named_seller) }
include_co... |
github | antiwork/gumroad | https://github.com/antiwork/gumroad | spec/controllers/products/available_offer_codes_controller_spec.rb | Ruby | mit | 8,966 | main | 8,977 | # frozen_string_literal: true
require "spec_helper"
require "shared_examples/authorize_called"
require "shared_examples/sellers_base_controller_concern"
describe Products::AvailableOfferCodesController do
it_behaves_like "inherits from Sellers::BaseController"
let(:seller) { create(:named_seller) }
let(:produc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.