From 357dca1d545251635c0774bfb176046e46525211 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 15:22:35 +0900 Subject: [PATCH 01/16] hack --- bin/hack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hack b/bin/hack index f4c622d9e..d630af24b 100755 --- a/bin/hack +++ b/bin/hack @@ -1,4 +1,4 @@ #!/usr/bin/env ruby # We redirect this script to a rake task because I don't know a better way to boot the Rails environment for this script. -exec "rake \"bullet_train:develop[#{ARGV.join(" ").gsub(",", "\\,")}]\"" +exec "rake \"bullet_train:hack[#{ARGV.join(" ").gsub(",", "\\,")}]\"" From f69ce745b799ba82f51de4f64cdd6392507399e2 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 15:23:00 +0900 Subject: [PATCH 02/16] Local gems --- Gemfile | 29 +++--- Gemfile.lock | 265 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 186 insertions(+), 108 deletions(-) diff --git a/Gemfile b/Gemfile index 57cb49b3d..4fd883fe6 100644 --- a/Gemfile +++ b/Gemfile @@ -100,20 +100,20 @@ end # This section is the list of Ruby gems included by default for Bullet Train. # Core packages. -gem "bullet_train" -gem "bullet_train-super_scaffolding" -gem "bullet_train-api" -gem "bullet_train-outgoing_webhooks" -gem "bullet_train-incoming_webhooks" -gem "bullet_train-themes" -gem "bullet_train-themes-light" -gem "bullet_train-integrations" -gem "bullet_train-integrations-stripe" +gem "bullet_train", path: "local/bullet_train-core/bullet_train" +gem "bullet_train-super_scaffolding", path: "local/bullet_train-core/bullet_train-super_scaffolding" +gem "bullet_train-api", path: "local/bullet_train-core/bullet_train-api" +gem "bullet_train-outgoing_webhooks", path: "local/bullet_train-core/bullet_train-outgoing_webhooks" +gem "bullet_train-incoming_webhooks", path: "local/bullet_train-core/bullet_train-incoming_webhooks" +gem "bullet_train-themes", path: "local/bullet_train-core/bullet_train-themes" +gem "bullet_train-themes-light", path: "local/bullet_train-core/bullet_train-themes-light" +gem "bullet_train-integrations", path: "local/bullet_train-core/bullet_train-integrations" +gem "bullet_train-integrations-stripe", path: "local/bullet_train-core/bullet_train-integrations-stripe" # Optional support packages. -gem "bullet_train-sortable" -gem "bullet_train-scope_questions" -gem "bullet_train-obfuscates_id" +gem "bullet_train-sortable", path: "local/bullet_train-core/bullet_train-sortable" +gem "bullet_train-scope_questions", path: "local/bullet_train-core/bullet_train-scope_questions" +gem "bullet_train-obfuscates_id", path: "local/bullet_train-core/bullet_train-obfuscates_id" gem "devise" gem "devise-two-factor" @@ -180,3 +180,8 @@ gem "pry" # that you run into a merge conflict in the future. # 🚅 super scaffolding will insert new oauth providers above this line. +gem "bullet_train-fields", path: "local/bullet_train-core/bullet_train-fields" +gem "bullet_train-has_uuid", path: "local/bullet_train-core/bullet_train-has_uuid" +gem "bullet_train-scope_validator", path: "local/bullet_train-core/bullet_train-scope_validator" +gem "bullet_train-super_load_and_authorize_resource", path: "local/bullet_train-core/bullet_train-super_load_and_authorize_resource" +gem "bullet_train-themes-tailwind_css", path: "local/bullet_train-core/bullet_train-themes-tailwind_css" diff --git a/Gemfile.lock b/Gemfile.lock index 07e70e4d6..52f99dc4d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,158 @@ GIT regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) +PATH + remote: local/bullet_train-core/bullet_train-api + specs: + bullet_train-api (1.2.25) + bullet_train + doorkeeper + factory_bot + jbuilder-schema (>= 2.0.0) + pagy + pagy_cursor + rack-cors + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-fields + specs: + bullet_train-fields (1.2.25) + chronic + cloudinary + phonelib + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-has_uuid + specs: + bullet_train-has_uuid (1.2.25) + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-incoming_webhooks + specs: + bullet_train-incoming_webhooks (1.2.25) + bullet_train-super_scaffolding + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-integrations-stripe + specs: + bullet_train-integrations-stripe (1.2.25) + omniauth + omniauth-rails_csrf_protection + omniauth-stripe-connect + rails (>= 6.0.0) + stripe + +PATH + remote: local/bullet_train-core/bullet_train-integrations + specs: + bullet_train-integrations (1.2.25) + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-obfuscates_id + specs: + bullet_train-obfuscates_id (1.2.25) + hashids + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-outgoing_webhooks + specs: + bullet_train-outgoing_webhooks (1.2.25) + public_suffix + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-scope_questions + specs: + bullet_train-scope_questions (1.2.25) + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-scope_validator + specs: + bullet_train-scope_validator (1.2.25) + +PATH + remote: local/bullet_train-core/bullet_train-sortable + specs: + bullet_train-sortable (1.2.25) + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-super_load_and_authorize_resource + specs: + bullet_train-super_load_and_authorize_resource (1.2.25) + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-super_scaffolding + specs: + bullet_train-super_scaffolding (1.2.25) + bullet_train + indefinite_article + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-themes-light + specs: + bullet_train-themes-light (1.2.25) + bullet_train-themes-tailwind_css + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-themes-tailwind_css + specs: + bullet_train-themes-tailwind_css (1.2.25) + bullet_train + bullet_train-themes + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train-themes + specs: + bullet_train-themes (1.2.25) + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-core/bullet_train + specs: + bullet_train (1.2.25) + awesome_print + bullet_train-fields + bullet_train-has_uuid + bullet_train-roles + bullet_train-routes + bullet_train-scope_validator + bullet_train-super_load_and_authorize_resource + bullet_train-themes + cable_ready (= 5.0.0.pre9) + cancancan + commonmarker + devise + devise-pwned_password + extended_email_reply_parser + fastimage + figaro + hiredis + http_accept_language + microscope + nice_partials (~> 0.9) + pagy + possessive + premailer-rails + rails (>= 6.0.0) + ruby-openai + showcase-rails + sidekiq + unicode-emoji + valid_email + xxhash + GEM remote: https://rubygems.org/ specs: @@ -110,96 +262,12 @@ GEM bootsnap (1.16.0) msgpack (~> 1.2) builder (3.2.4) - bullet_train (1.2.25) - awesome_print - bullet_train-fields - bullet_train-has_uuid - bullet_train-roles - bullet_train-routes - bullet_train-scope_validator - bullet_train-super_load_and_authorize_resource - bullet_train-themes - cable_ready (= 5.0.0.pre9) - cancancan - commonmarker - devise - devise-pwned_password - extended_email_reply_parser - fastimage - figaro - hiredis - http_accept_language - microscope - nice_partials (~> 0.9) - pagy - possessive - premailer-rails - rails (>= 6.0.0) - ruby-openai - showcase-rails - sidekiq - unicode-emoji - valid_email - xxhash - bullet_train-api (1.2.25) - bullet_train - doorkeeper - factory_bot - jbuilder-schema (>= 2.0.0) - pagy - pagy_cursor - rack-cors - rails (>= 6.0.0) - bullet_train-fields (1.2.25) - chronic - cloudinary - phonelib - rails (>= 6.0.0) - bullet_train-has_uuid (1.2.25) - rails (>= 6.0.0) - bullet_train-incoming_webhooks (1.2.25) - bullet_train-super_scaffolding - rails (>= 6.0.0) - bullet_train-integrations (1.2.25) - rails (>= 6.0.0) - bullet_train-integrations-stripe (1.2.25) - omniauth - omniauth-rails_csrf_protection - omniauth-stripe-connect - rails (>= 6.0.0) - stripe - bullet_train-obfuscates_id (1.2.25) - hashids - rails (>= 6.0.0) - bullet_train-outgoing_webhooks (1.2.25) - public_suffix - rails (>= 6.0.0) bullet_train-roles (1.2.25) active_hash activesupport cancancan bullet_train-routes (1.0.0) rails (>= 6.0.0) - bullet_train-scope_questions (1.2.25) - rails (>= 6.0.0) - bullet_train-scope_validator (1.2.25) - bullet_train-sortable (1.2.25) - rails (>= 6.0.0) - bullet_train-super_load_and_authorize_resource (1.2.25) - rails (>= 6.0.0) - bullet_train-super_scaffolding (1.2.25) - bullet_train - indefinite_article - rails (>= 6.0.0) - bullet_train-themes (1.2.25) - rails (>= 6.0.0) - bullet_train-themes-light (1.2.25) - bullet_train-themes-tailwind_css - rails (>= 6.0.0) - bullet_train-themes-tailwind_css (1.2.25) - bullet_train - bullet_train-themes - rails (>= 6.0.0) cable_ready (5.0.0.pre9) actioncable (>= 5.2) actionpack (>= 5.2) @@ -608,18 +676,23 @@ DEPENDENCIES active_hash aws-sdk-s3 bootsnap - bullet_train - bullet_train-api - bullet_train-incoming_webhooks - bullet_train-integrations - bullet_train-integrations-stripe - bullet_train-obfuscates_id - bullet_train-outgoing_webhooks - bullet_train-scope_questions - bullet_train-sortable - bullet_train-super_scaffolding - bullet_train-themes - bullet_train-themes-light + bullet_train! + bullet_train-api! + bullet_train-fields! + bullet_train-has_uuid! + bullet_train-incoming_webhooks! + bullet_train-integrations! + bullet_train-integrations-stripe! + bullet_train-obfuscates_id! + bullet_train-outgoing_webhooks! + bullet_train-scope_questions! + bullet_train-scope_validator! + bullet_train-sortable! + bullet_train-super_load_and_authorize_resource! + bullet_train-super_scaffolding! + bullet_train-themes! + bullet_train-themes-light! + bullet_train-themes-tailwind_css! capybara! capybara-email chronic From 89692d7687e400d54c065e34cec1b18355fce9f0 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 15:31:21 +0900 Subject: [PATCH 03/16] Add billing gems --- Gemfile | 3 +++ Gemfile.lock | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Gemfile b/Gemfile index 4fd883fe6..f1e5d6269 100644 --- a/Gemfile +++ b/Gemfile @@ -115,6 +115,9 @@ gem "bullet_train-sortable", path: "local/bullet_train-core/bullet_train-sortabl gem "bullet_train-scope_questions", path: "local/bullet_train-core/bullet_train-scope_questions" gem "bullet_train-obfuscates_id", path: "local/bullet_train-core/bullet_train-obfuscates_id" +gem "bullet_train-billing", path: "local/bullet_train-billing" +gem "bullet_train-billing-stripe", path: "local/bullet_train-billing-stripe" + gem "devise" gem "devise-two-factor" gem "rqrcode" diff --git a/Gemfile.lock b/Gemfile.lock index 52f99dc4d..2cf7ba3d0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,20 @@ GIT regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) +PATH + remote: local/bullet_train-billing-stripe + specs: + bullet_train-billing-stripe (1.0.1) + bullet_train-billing + rails (>= 6.0.0) + +PATH + remote: local/bullet_train-billing + specs: + bullet_train-billing (1.0.3) + bullet_train + rails (>= 6.0) + PATH remote: local/bullet_train-core/bullet_train-api specs: @@ -678,6 +692,8 @@ DEPENDENCIES bootsnap bullet_train! bullet_train-api! + bullet_train-billing! + bullet_train-billing-stripe! bullet_train-fields! bullet_train-has_uuid! bullet_train-incoming_webhooks! From 472ed87bf90d93b320bf3361b6b0d20bdec9369a Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 20:50:02 +0900 Subject: [PATCH 04/16] Update capybara logic for subscribing to a plan --- test/application_system_test_case.rb | 48 +++++++--------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index bfd25900d..66f66d593 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -284,12 +284,9 @@ def calculate_resolution(display_details) end def complete_pricing_page(card = nil) - assert page.has_content?("Select Your Plan") + assert page.has_content?("The Pricing Page") sleep 0.5 - within(".pricing-plan.highlight") do - start_subscription - end - + start_subscription complete_payment_page(card) end @@ -297,26 +294,22 @@ def complete_payment_page(card = nil) # we should be on the credit card page. if free_trial? assert page.has_content?("Start Your Free Trial") - assert page.has_content?("30-Day Free Trial".upcase) else - assert page.has_content?("Upgrade Your Account") - assert page.has_content?("It Will Work For You!".upcase) + assert page.has_content?("Subscribe to #{I18n.t("application.name")} Pro") + assert page.has_content?("Pay with card") end fill_in_stripe_elements(card) - if free_trial? - click_on "Start Free Trial" - else - click_on "Upgrade Now" - end + click_on "Subscribe" + sleep 1 end def start_subscription if free_trial? - click_on "Start Trial" + click_on "7-Day Free Trial" else - click_on "Sign Up" + click_on "Select" end end @@ -331,27 +324,10 @@ def fill_in_stripe_elements(card = nil) } using_wait_time(10) do - card_number_frame = find("#card-number iframe") - cvc_frame = find("#card-cvc iframe") - card_exp = find("#card-exp iframe") - - within_frame(card_number_frame) do - card[:card_number].chars.each do |digit| - find_field("cardnumber").send_keys(digit) - end - end - - within_frame(cvc_frame) do - card[:security_code].chars.each do |digit| - find_field("cvc").send_keys(digit) - end - end - - within_frame(card_exp) do - (card[:expiration_month] + card[:expiration_year]).chars.each do |digit| - find_field("exp-date").send_keys(digit) - end - end + fill_in placeholder: "1234 1234 1234 1234", with: card[:card_number] + fill_in placeholder: "MM / YY", with: card[:expiration_month] + card[:expiration_year] + fill_in placeholder: "CVC", with: card[:security_code] + fill_in "Name on card", with: "Hanako" end end From e49424872cf7fb0e208bcade659882b553907a19 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 20:50:19 +0900 Subject: [PATCH 05/16] Fix invitations test when billing is enabled --- test/system/invitations_test.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/system/invitations_test.rb b/test/system/invitations_test.rb index 0bd6c1926..7bb5010d8 100644 --- a/test/system/invitations_test.rb +++ b/test/system/invitations_test.rb @@ -34,12 +34,6 @@ def within_former_memberships_table fill_in "Confirm Password", with: example_password click_on "Sign Up" - if billing_enabled? - unless freemium_enabled? - complete_pricing_page - end - end - # we should now be on an onboarding step. assert page.has_content?("Tell us about you") fill_in "First Name", with: "Hanako" @@ -47,6 +41,12 @@ def within_former_memberships_table fill_in "Your Team Name", with: "The Testing Team" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + assert page.has_content?("The Testing Team’s Dashboard") within_team_menu_for(display_details) do click_on "Team Members" @@ -194,6 +194,12 @@ def within_former_memberships_table fill_in "Team Name", with: "Another Team" click_on "Create Team" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + assert page.has_content?("Another Team’s Dashboard") within_team_menu_for(display_details) do click_on "Team Members" From 4de70a62eb0be53d01d5436233614c5165cee4d6 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 20:51:41 +0900 Subject: [PATCH 06/16] Reset local gems --- Gemfile | 29 +++--- Gemfile.lock | 265 +++++++++++++++++++-------------------------------- 2 files changed, 108 insertions(+), 186 deletions(-) diff --git a/Gemfile b/Gemfile index f1e5d6269..14d3b256a 100644 --- a/Gemfile +++ b/Gemfile @@ -100,20 +100,20 @@ end # This section is the list of Ruby gems included by default for Bullet Train. # Core packages. -gem "bullet_train", path: "local/bullet_train-core/bullet_train" -gem "bullet_train-super_scaffolding", path: "local/bullet_train-core/bullet_train-super_scaffolding" -gem "bullet_train-api", path: "local/bullet_train-core/bullet_train-api" -gem "bullet_train-outgoing_webhooks", path: "local/bullet_train-core/bullet_train-outgoing_webhooks" -gem "bullet_train-incoming_webhooks", path: "local/bullet_train-core/bullet_train-incoming_webhooks" -gem "bullet_train-themes", path: "local/bullet_train-core/bullet_train-themes" -gem "bullet_train-themes-light", path: "local/bullet_train-core/bullet_train-themes-light" -gem "bullet_train-integrations", path: "local/bullet_train-core/bullet_train-integrations" -gem "bullet_train-integrations-stripe", path: "local/bullet_train-core/bullet_train-integrations-stripe" +gem "bullet_train" +gem "bullet_train-super_scaffolding" +gem "bullet_train-api" +gem "bullet_train-outgoing_webhooks" +gem "bullet_train-incoming_webhooks" +gem "bullet_train-themes" +gem "bullet_train-themes-light" +gem "bullet_train-integrations" +gem "bullet_train-integrations-stripe" # Optional support packages. -gem "bullet_train-sortable", path: "local/bullet_train-core/bullet_train-sortable" -gem "bullet_train-scope_questions", path: "local/bullet_train-core/bullet_train-scope_questions" -gem "bullet_train-obfuscates_id", path: "local/bullet_train-core/bullet_train-obfuscates_id" +gem "bullet_train-sortable" +gem "bullet_train-scope_questions" +gem "bullet_train-obfuscates_id" gem "bullet_train-billing", path: "local/bullet_train-billing" gem "bullet_train-billing-stripe", path: "local/bullet_train-billing-stripe" @@ -183,8 +183,3 @@ gem "pry" # that you run into a merge conflict in the future. # 🚅 super scaffolding will insert new oauth providers above this line. -gem "bullet_train-fields", path: "local/bullet_train-core/bullet_train-fields" -gem "bullet_train-has_uuid", path: "local/bullet_train-core/bullet_train-has_uuid" -gem "bullet_train-scope_validator", path: "local/bullet_train-core/bullet_train-scope_validator" -gem "bullet_train-super_load_and_authorize_resource", path: "local/bullet_train-core/bullet_train-super_load_and_authorize_resource" -gem "bullet_train-themes-tailwind_css", path: "local/bullet_train-core/bullet_train-themes-tailwind_css" diff --git a/Gemfile.lock b/Gemfile.lock index 2cf7ba3d0..013288b8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,158 +26,6 @@ PATH bullet_train rails (>= 6.0) -PATH - remote: local/bullet_train-core/bullet_train-api - specs: - bullet_train-api (1.2.25) - bullet_train - doorkeeper - factory_bot - jbuilder-schema (>= 2.0.0) - pagy - pagy_cursor - rack-cors - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-fields - specs: - bullet_train-fields (1.2.25) - chronic - cloudinary - phonelib - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-has_uuid - specs: - bullet_train-has_uuid (1.2.25) - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-incoming_webhooks - specs: - bullet_train-incoming_webhooks (1.2.25) - bullet_train-super_scaffolding - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-integrations-stripe - specs: - bullet_train-integrations-stripe (1.2.25) - omniauth - omniauth-rails_csrf_protection - omniauth-stripe-connect - rails (>= 6.0.0) - stripe - -PATH - remote: local/bullet_train-core/bullet_train-integrations - specs: - bullet_train-integrations (1.2.25) - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-obfuscates_id - specs: - bullet_train-obfuscates_id (1.2.25) - hashids - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-outgoing_webhooks - specs: - bullet_train-outgoing_webhooks (1.2.25) - public_suffix - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-scope_questions - specs: - bullet_train-scope_questions (1.2.25) - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-scope_validator - specs: - bullet_train-scope_validator (1.2.25) - -PATH - remote: local/bullet_train-core/bullet_train-sortable - specs: - bullet_train-sortable (1.2.25) - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-super_load_and_authorize_resource - specs: - bullet_train-super_load_and_authorize_resource (1.2.25) - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-super_scaffolding - specs: - bullet_train-super_scaffolding (1.2.25) - bullet_train - indefinite_article - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-themes-light - specs: - bullet_train-themes-light (1.2.25) - bullet_train-themes-tailwind_css - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-themes-tailwind_css - specs: - bullet_train-themes-tailwind_css (1.2.25) - bullet_train - bullet_train-themes - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train-themes - specs: - bullet_train-themes (1.2.25) - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-core/bullet_train - specs: - bullet_train (1.2.25) - awesome_print - bullet_train-fields - bullet_train-has_uuid - bullet_train-roles - bullet_train-routes - bullet_train-scope_validator - bullet_train-super_load_and_authorize_resource - bullet_train-themes - cable_ready (= 5.0.0.pre9) - cancancan - commonmarker - devise - devise-pwned_password - extended_email_reply_parser - fastimage - figaro - hiredis - http_accept_language - microscope - nice_partials (~> 0.9) - pagy - possessive - premailer-rails - rails (>= 6.0.0) - ruby-openai - showcase-rails - sidekiq - unicode-emoji - valid_email - xxhash - GEM remote: https://rubygems.org/ specs: @@ -276,12 +124,96 @@ GEM bootsnap (1.16.0) msgpack (~> 1.2) builder (3.2.4) + bullet_train (1.2.25) + awesome_print + bullet_train-fields + bullet_train-has_uuid + bullet_train-roles + bullet_train-routes + bullet_train-scope_validator + bullet_train-super_load_and_authorize_resource + bullet_train-themes + cable_ready (= 5.0.0.pre9) + cancancan + commonmarker + devise + devise-pwned_password + extended_email_reply_parser + fastimage + figaro + hiredis + http_accept_language + microscope + nice_partials (~> 0.9) + pagy + possessive + premailer-rails + rails (>= 6.0.0) + ruby-openai + showcase-rails + sidekiq + unicode-emoji + valid_email + xxhash + bullet_train-api (1.2.25) + bullet_train + doorkeeper + factory_bot + jbuilder-schema (>= 2.0.0) + pagy + pagy_cursor + rack-cors + rails (>= 6.0.0) + bullet_train-fields (1.2.25) + chronic + cloudinary + phonelib + rails (>= 6.0.0) + bullet_train-has_uuid (1.2.25) + rails (>= 6.0.0) + bullet_train-incoming_webhooks (1.2.25) + bullet_train-super_scaffolding + rails (>= 6.0.0) + bullet_train-integrations (1.2.25) + rails (>= 6.0.0) + bullet_train-integrations-stripe (1.2.25) + omniauth + omniauth-rails_csrf_protection + omniauth-stripe-connect + rails (>= 6.0.0) + stripe + bullet_train-obfuscates_id (1.2.25) + hashids + rails (>= 6.0.0) + bullet_train-outgoing_webhooks (1.2.25) + public_suffix + rails (>= 6.0.0) bullet_train-roles (1.2.25) active_hash activesupport cancancan bullet_train-routes (1.0.0) rails (>= 6.0.0) + bullet_train-scope_questions (1.2.25) + rails (>= 6.0.0) + bullet_train-scope_validator (1.2.25) + bullet_train-sortable (1.2.25) + rails (>= 6.0.0) + bullet_train-super_load_and_authorize_resource (1.2.25) + rails (>= 6.0.0) + bullet_train-super_scaffolding (1.2.25) + bullet_train + indefinite_article + rails (>= 6.0.0) + bullet_train-themes (1.2.25) + rails (>= 6.0.0) + bullet_train-themes-light (1.2.25) + bullet_train-themes-tailwind_css + rails (>= 6.0.0) + bullet_train-themes-tailwind_css (1.2.25) + bullet_train + bullet_train-themes + rails (>= 6.0.0) cable_ready (5.0.0.pre9) actioncable (>= 5.2) actionpack (>= 5.2) @@ -690,25 +622,20 @@ DEPENDENCIES active_hash aws-sdk-s3 bootsnap - bullet_train! - bullet_train-api! + bullet_train + bullet_train-api bullet_train-billing! bullet_train-billing-stripe! - bullet_train-fields! - bullet_train-has_uuid! - bullet_train-incoming_webhooks! - bullet_train-integrations! - bullet_train-integrations-stripe! - bullet_train-obfuscates_id! - bullet_train-outgoing_webhooks! - bullet_train-scope_questions! - bullet_train-scope_validator! - bullet_train-sortable! - bullet_train-super_load_and_authorize_resource! - bullet_train-super_scaffolding! - bullet_train-themes! - bullet_train-themes-light! - bullet_train-themes-tailwind_css! + bullet_train-incoming_webhooks + bullet_train-integrations + bullet_train-integrations-stripe + bullet_train-obfuscates_id + bullet_train-outgoing_webhooks + bullet_train-scope_questions + bullet_train-sortable + bullet_train-super_scaffolding + bullet_train-themes + bullet_train-themes-light capybara! capybara-email chronic From 815fa8fee18f312be29dfe2fb236e65bc4492f5e Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 20:52:04 +0900 Subject: [PATCH 07/16] Revert hack back to develop --- bin/hack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hack b/bin/hack index d630af24b..f4c622d9e 100755 --- a/bin/hack +++ b/bin/hack @@ -1,4 +1,4 @@ #!/usr/bin/env ruby # We redirect this script to a rake task because I don't know a better way to boot the Rails environment for this script. -exec "rake \"bullet_train:hack[#{ARGV.join(" ").gsub(",", "\\,")}]\"" +exec "rake \"bullet_train:develop[#{ARGV.join(" ").gsub(",", "\\,")}]\"" From 394fa45764ec654e1f4aaae97e105710380b037d Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 21:43:38 +0900 Subject: [PATCH 08/16] Update more tests to pass with billing enabled --- test/system/account_management_test.rb | 12 +++++----- test/system/application_platform_test.rb | 12 +++++----- test/system/dates_helper_test.rb | 6 +++++ test/system/invitation_details_test.rb | 13 +++++++---- test/system/teams_test.rb | 28 +++++++++++++++++++++++- 5 files changed, 54 insertions(+), 17 deletions(-) diff --git a/test/system/account_management_test.rb b/test/system/account_management_test.rb index 1ca458aea..20f31a61b 100644 --- a/test/system/account_management_test.rb +++ b/test/system/account_management_test.rb @@ -15,12 +15,6 @@ class AccountManagementSystemTest < ApplicationSystemTestCase fill_in "Confirm Password", with: example_password click_on "Sign Up" - if billing_enabled? - unless freemium_enabled? - complete_pricing_page - end - end - # we should now be on an onboarding step. assert page.has_content?("Tell us about you") fill_in "First Name", with: "Testy" @@ -29,6 +23,12 @@ class AccountManagementSystemTest < ApplicationSystemTestCase page.select "Brisbane", from: "Your Time Zone" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + assert page.has_content?("The Testing Team’s Dashboard") user = User.find_by(email: "andrew.culver@gmail.com") diff --git a/test/system/application_platform_test.rb b/test/system/application_platform_test.rb index 56c5233f0..37a1baeee 100644 --- a/test/system/application_platform_test.rb +++ b/test/system/application_platform_test.rb @@ -29,12 +29,6 @@ def within_current_memberships_table fill_in "Confirm Password", with: example_password click_on "Sign Up" - if billing_enabled? - unless freemium_enabled? - complete_pricing_page - end - end - # we should now be on an onboarding step. assert page.has_content?("Tell us about you") fill_in "First Name", with: "Jane" @@ -42,6 +36,12 @@ def within_current_memberships_table fill_in "Your Team Name", with: "The Testing Team" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + # Create a new Platform Application within_developers_menu_for(display_details) do click_on "API" diff --git a/test/system/dates_helper_test.rb b/test/system/dates_helper_test.rb index 12f354521..9eab8fd30 100644 --- a/test/system/dates_helper_test.rb +++ b/test/system/dates_helper_test.rb @@ -19,6 +19,12 @@ class DatesHelperTest < ApplicationSystemTestCase select "(GMT+00:00) UTC", from: "Your Time Zone" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + # Create a Tangible Thing click_on "Creative Concepts" click_on "Add New Creative Concept" diff --git a/test/system/invitation_details_test.rb b/test/system/invitation_details_test.rb index 5091940c4..879e01b65 100644 --- a/test/system/invitation_details_test.rb +++ b/test/system/invitation_details_test.rb @@ -5,12 +5,20 @@ def setup super @jane = create :onboarded_user, first_name: "Jane", last_name: "Smith" @john = create :onboarded_user, first_name: "John", last_name: "Smith", email: "john@bullettrain.co" + + login_as(@jane, scope: :user) + visit root_path + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + sleep 3 end @@test_devices.each do |device_name, display_details| test "admin can create new non admin invitation on a #{device_name}" do resize_for(display_details) - login_as(@jane, scope: :user) visit new_account_team_invitation_path(@jane.current_team) fill_in "Email", with: "someone@bullettrain.co" click_on "Create Invitation" @@ -21,7 +29,6 @@ def setup test "admin can create new admin invitation on a #{device_name}" do resize_for(display_details) - login_as(@jane, scope: :user) visit new_account_team_invitation_path(@jane.current_team) fill_in "Email", with: "someone@bullettrain.co" check "Invite as Team Administrator" @@ -33,7 +40,6 @@ def setup test "admin can't create invalid invitation on a #{device_name}" do resize_for(display_details) - login_as(@jane, scope: :user) visit new_account_team_invitation_path(@jane.current_team) fill_in "Email", with: "" click_on "Create Invitation" @@ -43,7 +49,6 @@ def setup test "admin can cancel invitation on a #{device_name}" do resize_for(display_details) - login_as(@jane, scope: :user) membership = Membership.new(team: @jane.current_team, user_email: @john.email) create :invitation, team: @jane.current_team, from_membership: @jane.memberships.first, email: @john.email, membership: membership visit account_team_invitations_path(@jane.current_team) diff --git a/test/system/teams_test.rb b/test/system/teams_test.rb index 02099d746..408df30a2 100644 --- a/test/system/teams_test.rb +++ b/test/system/teams_test.rb @@ -19,7 +19,7 @@ def setup # we only see the plans page if payments are enabled. if billing_enabled? && !freemium_enabled? - assert page.has_content?("Select Your Plan") + assert page.has_content?("The Pricing Page") else assert page.has_content?("Team Jane") end @@ -52,6 +52,13 @@ def setup resize_for(display_details) login_as(@jane, scope: :user) visit account_team_path(@jane.current_team) + + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + within_team_menu_for(display_details) do click_link "Team Settings" end @@ -66,6 +73,13 @@ def setup resize_for(display_details) login_as(@jane, scope: :user) visit account_team_path(@jane.current_team) + + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + within_team_menu_for(display_details) do click_link "Team Settings" end @@ -83,6 +97,18 @@ def setup assert team.admins.include?(@jane.memberships.first) + # Ensure user has subscribed to billing plan. + visit root_path + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + + # TODO: For some reason, this test needs to sleep + # longer than usual to complete the pricing page. + sleep 5 + # Shows invited admins assert_difference "team.admins.size" do visit new_account_team_invitation_path(team) From 2944a67718b9a61a39ec30f11de0b1c2b3a192d7 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 21:44:28 +0900 Subject: [PATCH 09/16] Remove unneeded line from helper in application system test case --- test/application_system_test_case.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 66f66d593..b23dec783 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -296,13 +296,12 @@ def complete_payment_page(card = nil) assert page.has_content?("Start Your Free Trial") else assert page.has_content?("Subscribe to #{I18n.t("application.name")} Pro") - assert page.has_content?("Pay with card") end fill_in_stripe_elements(card) click_on "Subscribe" - sleep 1 + sleep 3 end def start_subscription From 961da700dabc69ac09230cda7da596c03ddb0666 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 21:59:20 +0900 Subject: [PATCH 10/16] Finish fixing tests for updated pricing page --- test/system/account_test.rb | 11 ++++++++--- test/system/authentication_test.rb | 12 ++++++------ test/system/fields_test.rb | 6 ++++++ test/system/membership_test.rb | 12 ++++++------ test/system/pagination_test.rb | 8 ++++++++ test/system/reactivity_system_test.rb | 6 ++++++ test/system/tangible_thing_test.rb | 6 ++++++ test/system/teams_test.rb | 7 +++---- 8 files changed, 49 insertions(+), 19 deletions(-) diff --git a/test/system/account_test.rb b/test/system/account_test.rb index 737fc1efa..ba31ee72b 100644 --- a/test/system/account_test.rb +++ b/test/system/account_test.rb @@ -4,12 +4,19 @@ class AccountTest < ApplicationSystemTestCase def setup super @jane = create :onboarded_user, first_name: "Jane", last_name: "Smith" + login_as(@jane, scope: :user) + visit root_path + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + sleep 5 + end + end end @@test_devices.each do |device_name, display_details| test "user can edit their account on a #{device_name}" do resize_for(display_details) - login_as(@jane, scope: :user) visit edit_account_user_path(@jane) fill_in "First Name", with: "Another" fill_in "Last Name", with: "Person" @@ -23,7 +30,6 @@ def setup test "user can edit password on a #{device_name} with valid current password" do resize_for(display_details) - login_as(@jane, scope: :user) visit edit_account_user_path(@jane) fill_in "Current Password", with: @jane.password fill_in "New Password", with: another_example_password @@ -42,7 +48,6 @@ def setup test "user cannot edit password on a #{device_name} with invalid current password" do resize_for(display_details) - login_as(@jane, scope: :user) visit edit_account_user_path(@jane) fill_in "Current Password", with: "invalid" fill_in "New Password", with: another_example_password diff --git a/test/system/authentication_test.rb b/test/system/authentication_test.rb index 8b8bb18c4..90665ff22 100644 --- a/test/system/authentication_test.rb +++ b/test/system/authentication_test.rb @@ -27,12 +27,6 @@ class AuthenticationSystemTest < ApplicationSystemTestCase fill_in "Confirm Password", with: example_password click_on "Sign Up" - if billing_enabled? - unless freemium_enabled? - complete_pricing_page - end - end - # we should now be on an onboarding step. assert page.has_content?("Tell us about you") fill_in "First Name", with: "Testy" @@ -40,6 +34,12 @@ class AuthenticationSystemTest < ApplicationSystemTestCase fill_in "Your Team Name", with: "The Testing Team" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + # sign out. sign_out_for(display_details) diff --git a/test/system/fields_test.rb b/test/system/fields_test.rb index eab35bb6c..90086c765 100644 --- a/test/system/fields_test.rb +++ b/test/system/fields_test.rb @@ -20,6 +20,12 @@ class AccountTest < ApplicationSystemTestCase page.select "Brisbane", from: "Your Time Zone" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + click_on "Add New Creative Concept" fill_in "Name", with: "My Generic Creative Concept" fill_in "Description", with: "Dummy description for my creative concept" diff --git a/test/system/membership_test.rb b/test/system/membership_test.rb index 7d24c5ab9..60cd3a072 100644 --- a/test/system/membership_test.rb +++ b/test/system/membership_test.rb @@ -34,12 +34,6 @@ def within_former_memberships_table fill_in "Confirm Password", with: example_password click_on "Sign Up" - if billing_enabled? - unless freemium_enabled? - complete_pricing_page - end - end - # we should now be on an onboarding step. assert page.has_content?("Tell us about you") fill_in "First Name", with: "Jane" @@ -47,6 +41,12 @@ def within_former_memberships_table fill_in "Your Team Name", with: "The Testing Team" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + within_team_menu_for(display_details) do click_on "Team Members" end diff --git a/test/system/pagination_test.rb b/test/system/pagination_test.rb index 123c03970..10ff63d78 100644 --- a/test/system/pagination_test.rb +++ b/test/system/pagination_test.rb @@ -19,6 +19,14 @@ def setup creative_concept.completely_concrete_tangible_things.create(text_field_value: "Test #{n + 1}") end + visit root_path + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + sleep 5 + end + end + visit account_scaffolding_absolutely_abstract_creative_concept_path(creative_concept) assert page.has_content?("Test 1") diff --git a/test/system/reactivity_system_test.rb b/test/system/reactivity_system_test.rb index b55d43006..e7cb62e87 100644 --- a/test/system/reactivity_system_test.rb +++ b/test/system/reactivity_system_test.rb @@ -20,6 +20,12 @@ class ReactivitySystemTest < ApplicationSystemTestCase page.select "Brisbane", from: "Your Time Zone" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + # We should be on the account dashboard with no Creative Concepts listed. assert page.has_content? "My Super Team’s Dashboard" assert page.has_content? "If you're wondering what this" diff --git a/test/system/tangible_thing_test.rb b/test/system/tangible_thing_test.rb index e9266fb54..5efadaeb6 100644 --- a/test/system/tangible_thing_test.rb +++ b/test/system/tangible_thing_test.rb @@ -20,6 +20,12 @@ class TangibleThingTest < ApplicationSystemTestCase page.select "Brisbane", from: "Your Time Zone" click_on "Next" + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + end + end + click_on "Add New Creative Concept" fill_in "Name", with: "My Generic Creative Concept" fill_in "Description", with: "Dummy description for my creative concept" diff --git a/test/system/teams_test.rb b/test/system/teams_test.rb index 408df30a2..fd469c326 100644 --- a/test/system/teams_test.rb +++ b/test/system/teams_test.rb @@ -102,13 +102,12 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page + # TODO: For some reason, this test needs to sleep + # longer than usual to complete the pricing page. + sleep 5 end end - # TODO: For some reason, this test needs to sleep - # longer than usual to complete the pricing page. - sleep 5 - # Shows invited admins assert_difference "team.admins.size" do visit new_account_team_invitation_path(team) From 6650cca7abc2bd6079ceebfb43db6d771b016593 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 22:14:28 +0900 Subject: [PATCH 11/16] Fix remaining tests --- test/system/animations_test.rb | 7 +++++++ test/system/webhooks_system_test.rb | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/system/animations_test.rb b/test/system/animations_test.rb index 810428991..11bc0d365 100644 --- a/test/system/animations_test.rb +++ b/test/system/animations_test.rb @@ -16,6 +16,13 @@ def setup animation_duration = 0.5 resize_for(display_details) login_as(@jane, scope: :user) + visit root_path + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + sleep 5 + end + end visit account_team_path(@jane.current_team) diff --git a/test/system/webhooks_system_test.rb b/test/system/webhooks_system_test.rb index 2ba26bb08..2a4b524b0 100644 --- a/test/system/webhooks_system_test.rb +++ b/test/system/webhooks_system_test.rb @@ -16,6 +16,15 @@ def setup test "team member registers for webhooks and then receives them on #{device_name}" do resize_for(display_details) login_as(@user, scope: :user) + + visit root_path + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + sleep 5 + end + end + visit account_dashboard_path # create the endpoint. @@ -104,6 +113,14 @@ def setup # create a thing as another user and confirm no webhooks are issued to the original user. login_as(@another_user, scope: :user) + visit root_path + if billing_enabled? + unless freemium_enabled? + complete_pricing_page + sleep 5 + end + end + visit account_dashboard_path # trigger the webhook event. From f74b3deb6158124c275543507b3983782f4c8f8f Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Mon, 15 May 2023 22:29:44 +0900 Subject: [PATCH 12/16] Remove local gems --- Gemfile | 3 --- Gemfile.lock | 16 ---------------- 2 files changed, 19 deletions(-) diff --git a/Gemfile b/Gemfile index 14d3b256a..57cb49b3d 100644 --- a/Gemfile +++ b/Gemfile @@ -115,9 +115,6 @@ gem "bullet_train-sortable" gem "bullet_train-scope_questions" gem "bullet_train-obfuscates_id" -gem "bullet_train-billing", path: "local/bullet_train-billing" -gem "bullet_train-billing-stripe", path: "local/bullet_train-billing-stripe" - gem "devise" gem "devise-two-factor" gem "rqrcode" diff --git a/Gemfile.lock b/Gemfile.lock index 013288b8a..07e70e4d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,20 +12,6 @@ GIT regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) -PATH - remote: local/bullet_train-billing-stripe - specs: - bullet_train-billing-stripe (1.0.1) - bullet_train-billing - rails (>= 6.0.0) - -PATH - remote: local/bullet_train-billing - specs: - bullet_train-billing (1.0.3) - bullet_train - rails (>= 6.0) - GEM remote: https://rubygems.org/ specs: @@ -624,8 +610,6 @@ DEPENDENCIES bootsnap bullet_train bullet_train-api - bullet_train-billing! - bullet_train-billing-stripe! bullet_train-incoming_webhooks bullet_train-integrations bullet_train-integrations-stripe From 6adef1fba299e46412c0ada1f5d4c1828bd01f0c Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Tue, 16 May 2023 19:26:13 +0900 Subject: [PATCH 13/16] Fix fields system test --- test/system/fields_test.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/system/fields_test.rb b/test/system/fields_test.rb index 90086c765..58b5ee882 100644 --- a/test/system/fields_test.rb +++ b/test/system/fields_test.rb @@ -6,6 +6,9 @@ class AccountTest < ApplicationSystemTestCase test "simulate restoring behavior of form fields on page restore on #{device_name}" do resize_for(display_details) + # Ensure no one is logged in when running the entire test suite. + sign_out_for(display_details) + visit root_path invitation_only? ? be_invited_to_sign_up : click_on("Don't have an account?") From 573296f4ebebc7bbd4b7f4c07cf859c1633b875f Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Tue, 16 May 2023 19:55:35 +0900 Subject: [PATCH 14/16] Refactor system tests with billing --- test/application_system_test_case.rb | 14 ++------------ test/system/account_test.rb | 2 +- test/system/animations_test.rb | 2 +- test/system/invitation_details_test.rb | 2 +- test/system/pagination_test.rb | 2 +- test/system/teams_test.rb | 4 +--- test/system/webhooks_system_test.rb | 4 ++-- 7 files changed, 9 insertions(+), 21 deletions(-) diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index b23dec783..a6dbf3866 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -292,24 +292,14 @@ def complete_pricing_page(card = nil) def complete_payment_page(card = nil) # we should be on the credit card page. - if free_trial? - assert page.has_content?("Start Your Free Trial") - else - assert page.has_content?("Subscribe to #{I18n.t("application.name")} Pro") - end - + assert page.has_content?("Subscribe to #{I18n.t("application.name")} Pro") fill_in_stripe_elements(card) - click_on "Subscribe" sleep 3 end def start_subscription - if free_trial? - click_on "7-Day Free Trial" - else - click_on "Select" - end + click_on "Select" end def fill_in_stripe_elements(card = nil) diff --git a/test/system/account_test.rb b/test/system/account_test.rb index ba31ee72b..ed4f1525f 100644 --- a/test/system/account_test.rb +++ b/test/system/account_test.rb @@ -9,7 +9,7 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page - sleep 5 + sleep 2 end end end diff --git a/test/system/animations_test.rb b/test/system/animations_test.rb index 11bc0d365..9bc99a221 100644 --- a/test/system/animations_test.rb +++ b/test/system/animations_test.rb @@ -20,7 +20,7 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page - sleep 5 + sleep 2 end end diff --git a/test/system/invitation_details_test.rb b/test/system/invitation_details_test.rb index 879e01b65..9adcc5d8b 100644 --- a/test/system/invitation_details_test.rb +++ b/test/system/invitation_details_test.rb @@ -11,9 +11,9 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page + sleep 2 end end - sleep 3 end @@test_devices.each do |device_name, display_details| diff --git a/test/system/pagination_test.rb b/test/system/pagination_test.rb index 10ff63d78..8b25a5412 100644 --- a/test/system/pagination_test.rb +++ b/test/system/pagination_test.rb @@ -23,7 +23,7 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page - sleep 5 + sleep 2 end end diff --git a/test/system/teams_test.rb b/test/system/teams_test.rb index fd469c326..e636cd674 100644 --- a/test/system/teams_test.rb +++ b/test/system/teams_test.rb @@ -102,9 +102,7 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page - # TODO: For some reason, this test needs to sleep - # longer than usual to complete the pricing page. - sleep 5 + sleep 2 end end diff --git a/test/system/webhooks_system_test.rb b/test/system/webhooks_system_test.rb index 2a4b524b0..0045db471 100644 --- a/test/system/webhooks_system_test.rb +++ b/test/system/webhooks_system_test.rb @@ -21,7 +21,7 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page - sleep 5 + sleep 2 end end @@ -117,7 +117,7 @@ def setup if billing_enabled? unless freemium_enabled? complete_pricing_page - sleep 5 + sleep 2 end end From cf3a2e9535aca5d147544fa9cc18acb2853d181e Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Tue, 16 May 2023 20:08:35 +0900 Subject: [PATCH 15/16] Add TODO for fields system test --- test/system/fields_test.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/system/fields_test.rb b/test/system/fields_test.rb index 58b5ee882..eb352442e 100644 --- a/test/system/fields_test.rb +++ b/test/system/fields_test.rb @@ -6,11 +6,16 @@ class AccountTest < ApplicationSystemTestCase test "simulate restoring behavior of form fields on page restore on #{device_name}" do resize_for(display_details) - # Ensure no one is logged in when running the entire test suite. - sign_out_for(display_details) - visit root_path + # TODO: This is an ugly hack to ensure the default test user isn't logged in. + # This is happening when billing is enabled and the entire test suite is run. + if page.text.match?("Jane Smith") + puts "Running here." + sign_out_for(display_details) + visit root_path + end + invitation_only? ? be_invited_to_sign_up : click_on("Don't have an account?") assert page.has_content?("Create Your Account") fill_in "Your Email Address", with: "me@acme.com" From 58f781459031470b796a537415959ad0e314a925 Mon Sep 17 00:00:00 2001 From: Gabriel Zayas Date: Tue, 16 May 2023 20:09:09 +0900 Subject: [PATCH 16/16] More edits to fields test --- test/system/fields_test.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/system/fields_test.rb b/test/system/fields_test.rb index eb352442e..883ae82f6 100644 --- a/test/system/fields_test.rb +++ b/test/system/fields_test.rb @@ -11,8 +11,7 @@ class AccountTest < ApplicationSystemTestCase # TODO: This is an ugly hack to ensure the default test user isn't logged in. # This is happening when billing is enabled and the entire test suite is run. if page.text.match?("Jane Smith") - puts "Running here." - sign_out_for(display_details) + sign_out_for(display_details) visit root_path end