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/controllers/discover/search_autocomplete_controller_spec.rb
Ruby
mit
8,966
main
1,983
# frozen_string_literal: true require "spec_helper" describe Discover::SearchAutocompleteController do render_views describe "#delete_search_suggestion" do let(:user) { create(:user) } let(:browser_guid) { "custom_guid" } before do cookies[:_gumroad_guid] = browser_guid end context "w...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/oauth/access_tokens_constroller_spec.rb
Ruby
mit
8,966
main
2,404
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" describe Oauth::AccessTokensController do it_behaves_like "inherits from Sellers::BaseController" let(:seller) { create(:named_seller) } include_context "wit...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/oauth/applications_controller_spec.rb
Ruby
mit
8,966
main
11,198
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" require "inertia_rails/rspec" describe Oauth::ApplicationsController, type: :controller, inertia: true do shared_examples_for "redirects to page with OAuth apps" do it "redirects to settings_advanced_path" do ra...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/oauth/mobile_pre_authorizations_controller_spec.rb
Ruby
mit
8,966
main
2,529
# frozen_string_literal: true require "spec_helper" describe Oauth::MobilePreAuthorizationsController do render_views describe "GET new" do context "when user is logged in" do before do @user = create(:user) sign_in @user end it "renders the pre-authorization prompt with us...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/oauth/authorized_applications_controller_spec.rb
Ruby
mit
8,966
main
1,337
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" describe Oauth::AuthorizedApplicationsController do before do @user = create(:user) @application = create(:oauth_application, owner: @user) create("doorkeeper/access_token", resource_owner_id: @user.id, applic...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/oauth/notion/authorizations_controller_spec.rb
Ruby
mit
8,966
main
744
# frozen_string_literal: true require "spec_helper" describe Oauth::Notion::AuthorizationsController do describe "GET new" do let(:user) { create(:user) } let(:oauth_application) { create(:oauth_application, owner: user, scopes: "unfurl", redirect_uri: "https://example.com") } before do sign_in u...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/bundles/product_controller_spec.rb
Ruby
mit
8,966
main
15,484
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" require "inertia_rails/rspec" describe Bundles::ProductController, inertia: true do let(:seller) { create(:named_seller, :eligible_for_service_products) } let(:b...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/bundles/share_controller_spec.rb
Ruby
mit
8,966
main
4,088
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" require "inertia_rails/rspec" describe Bundles::ShareController, inertia: true do let(:seller) { create(:named_seller, :eligible_for_service_products) } let(:bun...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/bundles/content_controller_spec.rb
Ruby
mit
8,966
main
6,838
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" require "inertia_rails/rspec" describe Bundles::ContentController, inertia: true do let(:seller) { create(:named_seller, :eligible_for_service_products) } let(:b...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/integrations/zoom_controller_spec.rb
Ruby
mit
8,966
main
6,061
# frozen_string_literal: true require "spec_helper" describe Integrations::ZoomController do before do sign_in create(:user) end let(:authorization_code) { "test_code" } let(:oauth_request_body) do { grant_type: "authorization_code", code: authorization_code, redirect_uri: oauth_red...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/integrations/discord_controller_spec.rb
Ruby
mit
8,966
main
21,012
# frozen_string_literal: true require "spec_helper" describe Integrations::DiscordController do before do sign_in create(:user) end let(:oauth_request_body) do { grant_type: "authorization_code", code: "test_code", client_id: DISCORD_CLIENT_ID, client_secret: DISCORD_CLIENT_SECR...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/integrations/google_calendar_controller_spec.rb
Ruby
mit
8,966
main
9,885
# frozen_string_literal: true require "spec_helper" describe Integrations::GoogleCalendarController do before do sign_in create(:user) end let(:authorization_code) { "test_code" } let(:oauth_request_body) do { grant_type: "authorization_code", code: authorization_code, redirect_uri:...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/integrations/circle_controller_spec.rb
Ruby
mit
8,966
main
8,699
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" describe Integrations::CircleController, :vcr, :without_circle_rate_limit do it_behaves_like "inherits from Sellers::BaseController" let(:communities_list) do [ { "id" => 3512, "name" => "Gumroad", }...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/help_center/articles_controller_spec.rb
Ruby
mit
8,966
main
3,017
# frozen_string_literal: true require "spec_helper" require "inertia_rails/rspec" describe HelpCenter::ArticlesController, inertia: true do render_views describe "GET index" do it "returns successful response with Inertia page data" do get :index expect(response).to be_successful expect(ine...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/help_center/categories_controller_spec.rb
Ruby
mit
8,966
main
1,282
# frozen_string_literal: true require "spec_helper" require "inertia_rails/rspec" describe HelpCenter::CategoriesController, inertia: true do render_views describe "GET show" do let(:category) { HelpCenter::Category.first } it "returns successful response with Inertia page data" do get :show, para...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/links_controller_spec.rb
Ruby
mit
8,966
main
103,219
# frozen_string_literal: true require "spec_helper" require "net/http" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::LinksController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) end describe "GET 'index'" do before do ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/tax_forms_controller_spec.rb
Ruby
mit
8,966
main
9,356
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::TaxFormsController do let(:seller) { create(:user, created_at: Time.new(2022, 1, 1)) } let(:app) { create(:oauth_application, owner: create(:user)) } let(:token) { create("doorkeeper/ac...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/variants_controller_spec.rb
Ruby
mit
8,966
main
23,391
# frozen_string_literal: true require "spec_helper" require "net/http" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::VariantsController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) end describe "GET 'index'" do before do ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/custom_fields_controller_spec.rb
Ruby
mit
8,966
main
8,050
# frozen_string_literal: true require "spec_helper" require "net/http" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::CustomFieldsController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) @custom_fields = [create(:custom_field, name...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/payouts_controller_spec.rb
Ruby
mit
8,966
main
40,071
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::PayoutsController do before do stub_const("ObfuscateIds::CIPHER_KEY", "a" * 32) stub_const("ObfuscateIds::NUMERIC_CIPHER_KEY", 123456789) @seller = create(:user) @other_sel...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/skus_controller_spec.rb
Ruby
mit
8,966
main
3,686
# frozen_string_literal: true require "spec_helper" describe Api::V2::SkusController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) end describe "GET 'index'" do before do @product = create(:product, user: @user, description: "des", created_at: Time...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/covers_controller_spec.rb
Ruby
mit
8,966
main
6,739
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::CoversController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) @product = create(:product, user: @user) end describe "POST 'cre...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/offer_codes_controller_spec.rb
Ruby
mit
8,966
main
12,851
# frozen_string_literal: true require "spec_helper" require "net/http" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::OfferCodesController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) end describe "GET 'index'" do before do ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/variant_categories_controller_spec.rb
Ruby
mit
8,966
main
7,905
# frozen_string_literal: true require "spec_helper" require "net/http" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::VariantCategoriesController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) end describe "GET 'index'" do befo...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/resource_subscriptions_controller_spec.rb
Ruby
mit
8,966
main
12,682
# frozen_string_literal: true require "spec_helper" require "net/http" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::ResourceSubscriptionsController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) @token = create("doorkeeper/access_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/sales_controller_spec.rb
Ruby
mit
8,966
main
30,149
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::SalesController do before do @seller = create(:user) @purchaser = create(:user) @app = create(:oauth_application, owner: create(:user)) @product = create(:product, user: @se...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/bundle_contents_controller_spec.rb
Ruby
mit
8,966
main
11,398
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::BundleContentsController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) end describe "PUT 'update'" do before do @bundle =...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/subscribers_controller_spec.rb
Ruby
mit
8,966
main
6,701
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::SubscribersController do before do @seller = create(:user) @subscriber = create(:user) @app = create(:oauth_application, owner: create(:user)) @product = create(:subscriptio...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/thumbnails_controller_spec.rb
Ruby
mit
8,966
main
5,613
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::ThumbnailsController do before do @user = create(:user) @app = create(:oauth_application, owner: create(:user)) @product = create(:product, user: @user) end describe "POST ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/users_controller_spec.rb
Ruby
mit
8,966
main
5,275
# frozen_string_literal: true require "spec_helper" require "net/http" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::UsersController do before do @user = create(:user, username: "dude", email: "abc@def.ghi") @product = create(:product, user: @user) @purchase = create(:purcha...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/licenses_controller_spec.rb
Ruby
mit
8,966
main
33,721
# frozen_string_literal: true require "spec_helper" describe Api::V2::LicensesController do include ActionView::Helpers::DateHelper before do travel_to(Time.current) @product = create(:product, is_licensed: true, custom_permalink: "max") @license = create(:license, link: @product) @purchase = cre...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/files_controller_spec.rb
Ruby
mit
8,966
main
11,895
# frozen_string_literal: true require "spec_helper" describe Api::V2::FilesController do let(:user) { create(:user) } let(:app) { create(:oauth_application, owner: create(:user)) } describe "POST 'presign'" do let(:action) { :presign } let(:params) { { filename: "course.pdf", file_size: 1024 * 1024 } }...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/notion_unfurl_urls_controller_spec.rb
Ruby
mit
8,966
main
13,538
# frozen_string_literal: true require "spec_helper" describe Api::V2::NotionUnfurlUrlsController do let!(:seller) { create(:user, username: "john") } let!(:product) { create(:product, name: "An ultimate guide to become a programmer!", description: "<p>Lorem ipsum</p>", user: seller) } let!(:access_token) { crea...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/v2/earnings_controller_spec.rb
Ruby
mit
8,966
main
5,049
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_oauth_v1_api_method" describe Api::V2::EarningsController do let(:seller) { create(:user, created_at: Time.new(2022, 1, 1)) } let(:app) { create(:oauth_application, owner: create(:user)) } let(:token) { create("doorkeeper/ac...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/product_public_files_controller_spec.rb
Ruby
mit
8,966
main
2,601
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" require "shared_examples/authentication_required" describe Api::Internal::ProductPublicFilesController do let(:seller) { create(:user) } let(:product) { create(:product, user: seller) } include_context "with user sig...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/product_posts_controller_spec.rb
Ruby
mit
8,966
main
1,344
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" require "shared_examples/authentication_required" require "shared_examples/with_workflow_form_context" describe Api::Internal::ProductPostsController do let(:seller) { create(:user) } include_context "with user signed ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/ai_product_details_generations_controller_spec.rb
Ruby
mit
8,966
main
7,782
# frozen_string_literal: true require "spec_helper" require "shared_examples/authentication_required" require "shared_examples/authorize_called" describe Api::Internal::AiProductDetailsGenerationsController do let(:seller) { create(:named_seller) } include_context "with user signed in as admin for seller" des...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/home_page_numbers_controller_spec.rb
Ruby
mit
8,966
main
927
# frozen_string_literal: true require "spec_helper" describe Api::Internal::HomePageNumbersController do context "when the return value is cached" do let(:cached_value) do { prev_week_payout_usd: "$37,537" } end before do Rails.cache.write("homepage_numbers", cached_value) ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/existing_product_files_controller_spec.rb
Ruby
mit
8,966
main
1,678
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" require "shared_examples/authentication_required" require "shared_examples/with_workflow_form_context" describe Api::Internal::ExistingProductFilesController do let(:seller) { create(:user) } include_context "with user...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/mobile_minimum_versions_controller_spec.rb
Ruby
mit
8,966
main
1,724
# frozen_string_literal: true require "spec_helper" describe Api::Internal::MobileMinimumVersionsController do let(:user) { create(:user) } let(:app) { create(:oauth_application, owner: user) } let(:access_token) { create("doorkeeper/access_token", application: app, resource_owner_id: user.id, scopes: "account"...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/admin/purchases_controller_spec.rb
Ruby
mit
8,966
main
1,931
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_admin_api_method" describe Api::Internal::Admin::PurchasesController do describe "GET show" do include_examples "admin api authorization required", :get, :show, { id: "123" } it "returns purchase details for an exact pu...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/admin/users_controller_spec.rb
Ruby
mit
8,966
main
1,768
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_admin_api_method" describe Api::Internal::Admin::UsersController do describe "POST suspension" do include_examples "admin api authorization required", :post, :suspension it "returns compliant status for an unsuspended u...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/admin/licenses_controller_spec.rb
Ruby
mit
8,966
main
1,914
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_admin_api_method" describe Api::Internal::Admin::LicensesController do describe "POST lookup" do include_examples "admin api authorization required", :post, :lookup let(:product) { create(:product, name: "Licensed produ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/admin/base_controller_spec.rb
Ruby
mit
8,966
main
1,237
# frozen_string_literal: true require "spec_helper" describe Api::Internal::Admin::BaseController do controller(described_class) do def index render json: { success: true } end end before do allow(GlobalConfig).to receive(:get).and_call_original allow(GlobalConfig).to receive(:get).with("...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/admin/payouts_controller_spec.rb
Ruby
mit
8,966
main
2,953
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_admin_api_method" describe Api::Internal::Admin::PayoutsController do let(:user) { create(:compliant_user) } before do stub_const("GUMROAD_ADMIN_ID", create(:admin_user).id) end describe "POST list" do include_ex...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/product_review_videos/rejections_controller_spec.rb
Ruby
mit
8,966
main
2,326
# frozen_string_literal: true require "spec_helper" require "shared_examples/authentication_required" describe Api::Internal::ProductReviewVideos::RejectionsController do let!(:seller) { create(:user) } let(:buyer) { create(:user) } let(:product) { create(:product, user: seller) } let(:purchase) { create(:pur...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/product_review_videos/approvals_controller_spec.rb
Ruby
mit
8,966
main
2,327
# frozen_string_literal: true require "spec_helper" require "shared_examples/authentication_required" describe Api::Internal::ProductReviewVideos::ApprovalsController do let!(:seller) { create(:user) } let(:buyer) { create(:user) } let(:product) { create(:product, user: seller) } let(:purchase) { create(:purc...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/helper/instant_payouts_controller_spec.rb
Ruby
mit
8,966
main
2,849
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_helper_api_method" describe Api::Internal::Helper::InstantPayoutsController do let(:seller) { create(:user) } it "inherits from Api::Internal::Helper::BaseController" do expect(described_class.superclass).to eq(Api::Inter...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/helper/payouts_controller_spec.rb
Ruby
mit
8,966
main
9,894
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_helper_api_method" describe Api::Internal::Helper::PayoutsController do let(:user) { create(:compliant_user) } before do stub_const("GUMROAD_ADMIN_ID", create(:admin_user).id) end it "inherits from Api::Internal::Hel...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/helper/base_controller_spec.rb
Ruby
mit
8,966
main
3,955
# frozen_string_literal: true require "spec_helper" describe Api::Internal::Helper::BaseController do include HelperAISpecHelper controller(described_class) do before_action :authorize_hmac_signature!, only: :index skip_before_action :authorize_helper_token!, only: :index def index render json...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/helper/purchases_controller_spec.rb
Ruby
mit
8,966
main
30,118
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_helper_api_method" describe Api::Internal::Helper::PurchasesController, :vcr do include HelperAISpecHelper let(:buyer) { create(:user) } let(:admin_user) { create(:admin_user) } it "inherits from Api::Internal::Helper::B...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/helper/users_controller_spec.rb
Ruby
mit
8,966
main
20,800
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorized_helper_api_method" describe Api::Internal::Helper::UsersController do include HelperAISpecHelper let(:user) { create(:user_with_compliance_info) } let(:admin_user) { create(:admin_user) } before do @params = { email:...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/helper/webhook_controller_spec.rb
Ruby
mit
8,966
main
1,673
# frozen_string_literal: false require "spec_helper" describe Api::Internal::Helper::WebhookController do include HelperAISpecHelper it "inherits from Api::Internal::Helper::BaseController" do expect(described_class.superclass).to eq(Api::Internal::Helper::BaseController) end describe "POST handle" do ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/grmc/webhook_controller_spec.rb
Ruby
mit
8,966
main
2,360
# frozen_string_literal: true require "spec_helper" describe Api::Internal::Grmc::WebhookController do it "inherits from Api::Internal::BaseController" do expect(described_class.superclass).to eq(Api::Internal::BaseController) end def sign_request(timestamp, json) hmac = OpenSSL::HMAC.hexdigest("sha256...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/installments/preview_emails_controller_spec.rb
Ruby
mit
8,966
main
2,502
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" require "shared_examples/authentication_required" describe Api::Internal::Installments::PreviewEmailsController do let(:seller) { create(:user) } let(:installment) { create(:installment, seller:) } include_context "w...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/installments/audience_counts_controller_spec.rb
Ruby
mit
8,966
main
3,118
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" require "shared_examples/authentication_required" describe Api::Internal::Installments::AudienceCountsController do let(:seller) { create(:user) } include_context "with user signed in as admin for seller" describe "...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/internal/installments/recipient_counts_controller_spec.rb
Ruby
mit
8,966
main
6,244
# frozen_string_literal: true require "spec_helper" require "shared_examples/authorize_called" require "shared_examples/authentication_required" describe Api::Internal::Installments::RecipientCountsController do let(:seller) { create(:user) } include_context "with user signed in as admin for seller" describe ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/sessions_controller_spec.rb
Ruby
mit
8,966
main
1,078
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::SessionsController, :vcr do before do @user = create(:user) @app = create(:oauth_application, owner: @user) @params = { mobile_token: Api::Mobile::BaseController::MOBILE_TOKEN, access_token: create("doorkeeper/access_t...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/url_redirects_controller_spec.rb
Ruby
mit
8,966
main
22,872
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::UrlRedirectsController do before do @product = create(:product, name: "The Works of Edgar Gumstein", description: "A collection of works spanning 1984 — 1994") @product_file1 = create(:product_file, position: 0, link: @product, descri...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/feature_flags_controller_spec.rb
Ruby
mit
8,966
main
1,677
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::FeatureFlagsController do let(:user) { create(:user) } let(:app) { create(:oauth_application, owner: user) } let(:params) do { mobile_token: Api::Mobile::BaseController::MOBILE_TOKEN, access_token: create("doorkeeper/acces...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/analytics_controller_spec.rb
Ruby
mit
8,966
main
10,429
# frozen_string_literal: true require "spec_helper" require "shared_examples/paginated_api" describe Api::Mobile::AnalyticsController do before do @app = create(:oauth_application, owner: create(:user)) @user = create(:user, timezone: "UTC", created_at: Time.utc(2019)) @params = { mobile_token: Ap...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/consumption_analytics_controller_spec.rb
Ruby
mit
8,966
main
5,318
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::ConsumptionAnalyticsController do describe "POST create" do before do @user = create(:user) @purchaser = create(:user) @url_redirect = create(:readable_url_redirect, link: create(:product, user: @user), purchase: create(...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/purchases_controller_spec.rb
Ruby
mit
8,966
main
37,204
# frozen_string_literal: true require "spec_helper" require "shared_examples/paginated_api" describe Api::Mobile::PurchasesController do before do @user = create(:user) @purchaser = create(:user) @app = create(:oauth_application, owner: @user) @params = { mobile_token: Api::Mobile::BaseControl...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/media_locations_controller_spec.rb
Ruby
mit
8,966
main
8,327
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::MediaLocationsController do describe "POST create" do before do @user = create(:user) @purchaser = create(:user) @url_redirect = create(:readable_url_redirect, link: create(:product, user: @user), purchase: create(:purch...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/base_controller_spec.rb
Ruby
mit
8,966
main
882
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::BaseController do let(:application) { create(:oauth_application) } let(:admin_user) { create(:admin_user) } let(:access_token) do create( "doorkeeper/access_token", application:, resource_owner_id: admin_user.id, ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/sales_controller_spec.rb
Ruby
mit
8,966
main
4,447
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::SalesController, :vcr do before do @seller = create(:user) @product = create(:product, user: @seller) @purchaser = create(:user) @app = create(:oauth_application, owner: @seller) @params = { mobile_token: Api::Mobile...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/installments_controller_spec.rb
Ruby
mit
8,966
main
1,377
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::InstallmentsController do before do @product = create(:subscription_product, user: create(:user)) @post = create(:installment, link: @product, published_at: Time.current) @follower = create(:follower) end it "returns an error...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/subscriptions_controller_spec.rb
Ruby
mit
8,966
main
1,658
# frozen_string_literal: true require "spec_helper" require "net/http" describe Api::Mobile::SubscriptionsController, :vcr do before do @product = create(:subscription_product, user: create(:user)) @user = create(:user, credit_card: create(:credit_card)) @subscription = create(:subscription, link: @prod...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/api/mobile/devices_controller_spec.rb
Ruby
mit
8,966
main
4,376
# frozen_string_literal: true require "spec_helper" describe Api::Mobile::DevicesController do before do @user = create(:user) @app = create(:oauth_application, owner: @user) end describe "POST create" do context "when making a request while unauthenticated" do it "fails" do post :cre...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/global_affiliates/product_eligibility_controller_spec.rb
Ruby
mit
8,966
main
1,518
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" describe GlobalAffiliates::ProductEligibilityController do it_behaves_like "inherits from Sellers::BaseController" let(:seller) { create(:named_seller) } inc...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/checkout/discounts_controller_spec.rb
Ruby
mit
8,966
main
18,438
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" describe Checkout::DiscountsController do render_views let(:seller) { create(:named_seller) } def transform_offer_code_props(offer_code_props) offer_code...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/checkout/upsells_controller_spec.rb
Ruby
mit
8,966
main
16,690
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" describe Checkout::UpsellsController 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/checkout/form_controller_spec.rb
Ruby
mit
8,966
main
3,704
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" describe Checkout::FormController do render_views let(:seller) { create(:named_seller) } let(:pundit_user) { SellerContext.new(user: seller, seller:) } it_...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/checkout/upsells/products_controller_spec.rb
Ruby
mit
8,966
main
8,134
# frozen_string_literal: true require "spec_helper" describe Checkout::Upsells::ProductsController do let(:seller) { create(:named_seller) } let!(:product1) { create(:product, :recommendable, user: seller, name: "Product 1", price_cents: 1000, price_currency_type: "usd", native_type: "digital") } let!(:product2...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/checkout/upsells/pauses_controller_spec.rb
Ruby
mit
8,966
main
2,205
# frozen_string_literal: true require "spec_helper" require "shared_examples/sellers_base_controller_concern" require "shared_examples/authorize_called" describe Checkout::Upsells::PausesController do it_behaves_like "inherits from Sellers::BaseController" let(:seller) { create(:named_seller, :eligible_for_servi...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/controllers/users/review_reminders_controller_spec.rb
Ruby
mit
8,966
main
1,645
# frozen_string_literal: true require "spec_helper" require "inertia_rails/rspec" describe Users::ReviewRemindersController, type: :controller, inertia: true do describe "GET subscribe" do let(:user) { create(:user, opted_out_of_review_reminders: true) } context "when user is logged in" do it "render...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_sales_related_products_infos_job_spec.rb
Ruby
mit
8,966
main
2,350
# frozen_string_literal: true require "spec_helper" describe UpdateSalesRelatedProductsInfosJob do describe "#perform" do before do Feature.activate(:update_sales_related_products_infos) end let(:seller) { create(:named_seller) } let(:product1) { create(:product, user: seller) } let(:prod...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/duplicate_product_worker_spec.rb
Ruby
mit
8,966
main
1,346
# frozen_string_literal: true require "spec_helper" describe DuplicateProductWorker do describe "#perform" do before do @product = create(:product, name: "test product") end it "duplicates product successfully" do expect { described_class.new.perform(@product.id) }.to change(Link, :count).b...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/charge_preorder_worker_spec.rb
Ruby
mit
8,966
main
5,415
# frozen_string_literal: true require "spec_helper" describe ChargePreorderWorker, :vcr do describe "#perform" do before do @good_card = build(:chargeable) @good_card_but_cant_charge = build(:chargeable_success_charge_decline) product = create(:product, price_cents: 600, is_in_preorder_state: ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_payout_status_worker_spec.rb
Ruby
mit
8,966
main
3,702
# frozen_string_literal: true describe UpdatePayoutStatusWorker do describe "#perform" do context "when the payout is not created in the split mode" do let(:payment) { create(:payment, processor_fee_cents: 10, txn_id: "Some ID") } it "fetches and sets the new payment status from PayPal" do e...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_year_in_review_email_job_spec.rb
Ruby
mit
8,966
main
13,790
# frozen_string_literal: true describe SendYearInReviewEmailJob do include PaymentsHelper, ProductPageViewHelpers describe ".perform" do context "when no payouts exist for the selected year" do let(:date) { Date.new(2021, 2, 22) } let!(:seller) do create( :user_with_compliance_in...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/send_reminders_for_outstanding_user_compliance_info_requests_worker_spec.rb
Ruby
mit
8,966
main
7,578
# frozen_string_literal: true require "spec_helper" describe SendRemindersForOutstandingUserComplianceInfoRequestsWorker do describe "#perform" do let(:user_1) { create(:user) } let(:user_2) { create(:user) } let(:user_3) { create(:user) } let(:user_4) { create(:user) } let(:user_5) { create(:us...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/custom_domain_verification_worker_spec.rb
Ruby
mit
8,966
main
1,726
# frozen_string_literal: true require "spec_helper" describe CustomDomainVerificationWorker do let!(:valid_custom_domain) { create(:custom_domain) } let!(:invalid_custom_domain) { create(:custom_domain, state: "unverified", failed_verification_attempts_count: 2) } let!(:deleted_custom_domain) { create(:custom_d...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_payout_reversed_worker_spec.rb
Ruby
mit
8,966
main
2,231
# frozen_string_literal: true describe HandlePayoutReversedWorker do describe "#perform" do let(:payment) { create(:payment) } let(:reversing_payout_id) { "reversing-payout-id" } let(:stripe_account_id) { "stripe-account-id" } let(:reversing_payout_status) { raise "define `reversing_payout_status`" ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/schedule_membership_price_updates_job_spec.rb
Ruby
mit
8,966
main
13,195
# frozen_string_literal: true describe ScheduleMembershipPriceUpdatesJob do describe "perform" do context "for a non-tiered membership variant" do it "does nothing" do variant = create(:variant) purchase = create(:purchase, variant_attributes: [variant]) create(:subscription, origin...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/process_early_fraud_warning_job_spec.rb
Ruby
mit
8,966
main
7,029
# frozen_string_literal: true require "spec_helper" describe ProcessEarlyFraudWarningJob, :vcr do let(:purchase) { create(:purchase, stripe_transaction_id: "ch_2O8n7J9e1RjUNIyY1rs9MIRL") } let!(:early_fraud_warning) { create(:early_fraud_warning, purchase:) } describe "#perform" do context "when the disput...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_sns_transcoder_event_worker_spec.rb
Ruby
mit
8,966
main
1,648
# frozen_string_literal: true require "spec_helper" describe HandleSnsTranscoderEventWorker do describe "#perform" do before do @product = create(:product) @product.product_files << create(:product_file, link: @product, url: "#{AWS_S3_ENDPOINT}/#...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/regenerate_creator_analytics_cache_worker_spec.rb
Ruby
mit
8,966
main
761
# frozen_string_literal: true require "spec_helper" describe RegenerateCreatorAnalyticsCacheWorker do describe "#perform" do it "runs CreatorAnalytics::CachingProxy#overwrite_cache" do user = create(:user) service_object = double("CreatorAnalytics::CachingProxy object") expect(CreatorAnalytic...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/reissue_ssl_certificate_for_updated_custom_domains_spec.rb
Ruby
mit
8,966
main
1,284
# frozen_string_literal: true require "spec_helper" describe ReissueSslCertificateForUpdatedCustomDomains do describe "#perform" do before do custom_domain = create(:custom_domain) custom_domain.set_ssl_certificate_issued_at! end context "when valid certificates are not found for the domain...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/unsubscribe_and_fail_worker_spec.rb
Ruby
mit
8,966
main
3,155
# frozen_string_literal: true require "spec_helper" describe UnsubscribeAndFailWorker, :vcr do before do @product = create(:subscription_product, user: create(:user)) @subscription = create(:subscription, user: create(:user, credit_card: create(:credit_card)), link: @product) @purchase = create(:purchas...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/attach_past_purchases_to_user_worker_spec.rb
Ruby
mit
8,966
main
1,065
# frozen_string_literal: true require "spec_helper" describe AttachPastPurchasesToUserWorker do describe "#perform" do it "attaches unlinked purchases matching the user's email" do user = create(:user) purchase1 = create(:purchase, email: user.email, purchaser: nil) purchase2 = create(:purchas...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_sendgrid_event_job_spec.rb
Ruby
mit
8,966
main
1,856
# frozen_string_literal: true describe HandleSendgridEventJob do describe ".perform" do context "when the event type is not supported" do let(:params) do { "_json" => [ { "event" => "processed", "type" => "CustomerMailer.receipt", "ide...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/cancel_preorder_worker_spec.rb
Ruby
mit
8,966
main
1,781
# frozen_string_literal: true require "spec_helper" describe CancelPreorderWorker, :vcr do describe "perform" do it "cancels the preorder if it is in authorization_successful state but does not send notification emails" do product = create(:product) preorder_link = create(:preorder_link, link: produ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/low_balance_fraud_check_worker_spec.rb
Ruby
mit
8,966
main
373
# frozen_string_literal: true describe LowBalanceFraudCheckWorker do describe "#perform" do before do @purchase = create(:purchase) end it "invokes .check_for_low_balance_and_probate for the seller" do expect_any_instance_of(User).to receive(:check_for_low_balance_and_probate) describ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/update_cached_sales_related_products_infos_job_spec.rb
Ruby
mit
8,966
main
2,370
# frozen_string_literal: true require "spec_helper" describe UpdateCachedSalesRelatedProductsInfosJob do describe "#perform" do before do Feature.activate(:update_sales_related_products_infos) end let(:product) { create(:product) } let(:product_2) { create(:product) } let(:product_3) { cr...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/sync_stuck_payouts_job_spec.rb
Ruby
mit
8,966
main
13,437
# frozen_string_literal: true describe SyncStuckPayoutsJob do describe "#perform" do context "when processor type is PayPal" do before do create(:payment, processor: PayoutProcessorType::PAYPAL, state: "completed", txn_id: "12345", processor_fee_cents: 0) create(:payment, processor: PayoutP...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/create_vat_report_job_spec.rb
Ruby
mit
8,966
main
8,650
# frozen_string_literal: true require "spec_helper" describe CreateVatReportJob do it "raises an ArgumentError if the year is less than 2014 or greater than 3200" do expect do described_class.new.perform(2, 2013) end.to raise_error(ArgumentError) end it "raises an ArgumentError if the quarter is ...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/compile_gumroad_daily_analytics_job_spec.rb
Ruby
mit
8,966
main
2,083
# frozen_string_literal: true require "spec_helper" describe CompileGumroadDailyAnalyticsJob do it "compiles analytics for the refresh period" do stub_const("CompileGumroadDailyAnalyticsJob::REFRESH_PERIOD", 5.days) allow(Date).to receive(:today).and_return(Date.new(2023, 1, 15)) create :purchase, crea...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/handle_stripe_event_worker_spec.rb
Ruby
mit
8,966
main
952
# frozen_string_literal: true describe HandleStripeEventWorker do describe "perform" do describe "stripe_connect_account_id is not provided" do it "calls the StripeEventHandler" do id = rand(10_000).to_s expect_any_instance_of(StripeEventHandler).to receive(:handle_stripe_event) exp...
github
antiwork/gumroad
https://github.com/antiwork/gumroad
spec/sidekiq/delete_old_unused_events_worker_spec.rb
Ruby
mit
8,966
main
719
# frozen_string_literal: true require "spec_helper" describe DeleteOldUnusedEventsWorker do describe "#perform" do it "deletes targeted rows" do stub_const("#{described_class}::DELETION_BATCH_SIZE", 1) create(:event, event_name: "i_want_this", created_at: 2.months.ago - 1.day) permitted = cre...