From 2618df8843d9af6f21d921d459257abcfe670c9b Mon Sep 17 00:00:00 2001 From: Zach Gollwitzer Date: Thu, 1 May 2025 15:42:08 -0400 Subject: [PATCH] Fix tests --- .../controllers/theme_controller.js | 1 - app/views/pages/early_access.html.erb | 54 ------------------- config/routes.rb | 1 - .../subscriptions_controller_test.rb | 3 +- .../stripe/customer_event_processor_test.rb | 5 +- .../subscription_event_processor_test.rb | 4 +- test/system/trades_test.rb | 1 - 7 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 app/views/pages/early_access.html.erb diff --git a/app/javascript/controllers/theme_controller.js b/app/javascript/controllers/theme_controller.js index d411b549..4a7a9f48 100644 --- a/app/javascript/controllers/theme_controller.js +++ b/app/javascript/controllers/theme_controller.js @@ -69,7 +69,6 @@ export default class extends Controller { } toggle() { - console.log("toggle"); const currentTheme = document.documentElement.getAttribute("data-theme"); if (currentTheme === "dark") { this.toLight(); diff --git a/app/views/pages/early_access.html.erb b/app/views/pages/early_access.html.erb deleted file mode 100644 index b710d85f..00000000 --- a/app/views/pages/early_access.html.erb +++ /dev/null @@ -1,54 +0,0 @@ - - - - <%= content_for(:title) || "🔒 Maybe Early Access" %> - - <%= csrf_meta_tags %> - <%= csp_meta_tag %> - - <%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %> - - <%= javascript_importmap_tags %> - <%= turbo_refreshes_with method: :morph, scroll: :preserve %> - - - - - - - - - <%= yield :head %> - - - ');"> -
-
- <%= image_tag "logo-squircle.svg", alt: "Maybe Logo", class: "w-16 h-16 sm:w-18 sm:h-18 mx-auto mb-6 sm:mb-8" %> -

Maybe Early Access

- <% if @invite_codes_count > 0 %> -

There <%= @invite_codes_count == 1 ? "is" : "are" %> <%= @invite_codes_count %> invite <%= "code".pluralize(@invite_codes_count) %> remaining.

-
-

Your invite code is <%= @invite_code.token %>

-

<%= link_to "Sign up with this code", new_registration_path(invite: @invite_code.token), class: "block w-full bg-container text-black py-2 px-3 rounded-lg no-underline text-sm sm:text-base hover:bg-gray-200 transition duration-150" %>

-
- -

You may need to refresh the page to get a new invite code if someone else claimed it before you.

- -

- <%= link_to early_access_path, class: "w-full block text-center justify-center inline-flex items-center text-white hover:bg-gray-800 p-2 rounded-md text-base transition duration-150", data: { turbo_method: :get } do %> - <%= icon "refresh-cw", class: "mr-2" %> - Refresh page - <% end %> -

- <% else %> -

Sorry, there are no invite codes remaining. Join our <%= link_to "Discord server", "https://link.maybe.co/discord", target: "_blank", class: "text-white hover:text-gray-300" %> to get notified when new invite codes are available.

-

<%= link_to "Join Discord server", "https://link.maybe.co/discord", target: "_blank", class: "bg-container text-black px-3 py-2 rounded-md no-underline text-base hover:bg-gray-200 transition duration-150" %>

- <% end %> -
-
- - - diff --git a/config/routes.rb b/config/routes.rb index 90785c12..b0538fb1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,7 +24,6 @@ Rails.application.routes.draw do get "changelog", to: "pages#changelog" get "feedback", to: "pages#feedback" - get "early-access", to: "pages#early_access" resource :registration, only: %i[new create] resources :sessions, only: %i[new create destroy] diff --git a/test/controllers/subscriptions_controller_test.rb b/test/controllers/subscriptions_controller_test.rb index fe1b38d7..952aed3b 100644 --- a/test/controllers/subscriptions_controller_test.rb +++ b/test/controllers/subscriptions_controller_test.rb @@ -8,7 +8,6 @@ class SubscriptionsControllerTest < ActionDispatch::IntegrationTest test "redirects to settings if self hosting" do Rails.application.config.app_mode.stubs(:self_hosted?).returns(true) get subscription_path - assert_redirected_to root_path - assert_equal I18n.t("subscriptions.self_hosted_alert"), flash[:alert] + assert_response :forbidden end end diff --git a/test/models/provider/stripe/customer_event_processor_test.rb b/test/models/provider/stripe/customer_event_processor_test.rb index 83f71248..c3ab10e9 100644 --- a/test/models/provider/stripe/customer_event_processor_test.rb +++ b/test/models/provider/stripe/customer_event_processor_test.rb @@ -1,6 +1,7 @@ require "test_helper" class Provider::Stripe::CustomerEventProcessorTest < ActiveSupport::TestCase - test "process" do - end + # test "process" do + + # end end diff --git a/test/models/provider/stripe/subscription_event_processor_test.rb b/test/models/provider/stripe/subscription_event_processor_test.rb index 89004a2b..19c6b384 100644 --- a/test/models/provider/stripe/subscription_event_processor_test.rb +++ b/test/models/provider/stripe/subscription_event_processor_test.rb @@ -1,6 +1,6 @@ require "test_helper" class Provider::Stripe::SubscriptionEventProcessorTest < ActiveSupport::TestCase - test "process" do - end + # test "process" do + # end end diff --git a/test/system/trades_test.rb b/test/system/trades_test.rb index 6972f2a7..1222dfe7 100644 --- a/test/system/trades_test.rb +++ b/test/system/trades_test.rb @@ -55,7 +55,6 @@ class TradesTest < ApplicationSystemTestCase end private - def open_new_trade_modal click_on "New transaction" end