From 39644abf42381824431bb96a992c0faa08c62286 Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Tue, 3 Dec 2024 16:12:56 -0800 Subject: [PATCH] Move onboarding controller tests to test/functional These tests fit more with the functional paradigm since they are named after a controller and test one action at a time. --- .../onboarding/confirm_controller_test.rb | 0 .../organizations/onboarding/gems_controller_test.rb | 0 .../organizations/onboarding/name_controller_test.rb | 0 .../organizations/onboarding/users_controller_test.rb | 0 .../organizations/onboarding_controller_test.rb} | 10 +++++----- 5 files changed, 5 insertions(+), 5 deletions(-) rename test/{integration => functional}/organizations/onboarding/confirm_controller_test.rb (100%) rename test/{integration => functional}/organizations/onboarding/gems_controller_test.rb (100%) rename test/{integration => functional}/organizations/onboarding/name_controller_test.rb (100%) rename test/{integration => functional}/organizations/onboarding/users_controller_test.rb (100%) rename test/{integration/organizations/onboarding_test.rb => functional/organizations/onboarding_controller_test.rb} (88%) diff --git a/test/integration/organizations/onboarding/confirm_controller_test.rb b/test/functional/organizations/onboarding/confirm_controller_test.rb similarity index 100% rename from test/integration/organizations/onboarding/confirm_controller_test.rb rename to test/functional/organizations/onboarding/confirm_controller_test.rb diff --git a/test/integration/organizations/onboarding/gems_controller_test.rb b/test/functional/organizations/onboarding/gems_controller_test.rb similarity index 100% rename from test/integration/organizations/onboarding/gems_controller_test.rb rename to test/functional/organizations/onboarding/gems_controller_test.rb diff --git a/test/integration/organizations/onboarding/name_controller_test.rb b/test/functional/organizations/onboarding/name_controller_test.rb similarity index 100% rename from test/integration/organizations/onboarding/name_controller_test.rb rename to test/functional/organizations/onboarding/name_controller_test.rb diff --git a/test/integration/organizations/onboarding/users_controller_test.rb b/test/functional/organizations/onboarding/users_controller_test.rb similarity index 100% rename from test/integration/organizations/onboarding/users_controller_test.rb rename to test/functional/organizations/onboarding/users_controller_test.rb diff --git a/test/integration/organizations/onboarding_test.rb b/test/functional/organizations/onboarding_controller_test.rb similarity index 88% rename from test/integration/organizations/onboarding_test.rb rename to test/functional/organizations/onboarding_controller_test.rb index 8158d94a655..a549d660992 100644 --- a/test/integration/organizations/onboarding_test.rb +++ b/test/functional/organizations/onboarding_controller_test.rb @@ -8,7 +8,7 @@ class Organizations::OnboardingControllerTest < ActionDispatch::IntegrationTest context "GET /organizations/onboarding" do should "redirect to onboarding start page" do - get "/organizations/onboarding" + get organization_onboarding_path assert_redirected_to organization_onboarding_name_path end @@ -18,7 +18,7 @@ class Organizations::OnboardingControllerTest < ActionDispatch::IntegrationTest should "not destroy an OrganizationOnboarding that is already completed" do organization_onboarding = create(:organization_onboarding, :completed, created_by: @user) - delete "/organizations/onboarding" + delete organization_onboarding_path assert_redirected_to dashboard_path assert OrganizationOnboarding.exists?(id: organization_onboarding.id) @@ -27,7 +27,7 @@ class Organizations::OnboardingControllerTest < ActionDispatch::IntegrationTest should "destroy a pending OrganizationOnboarding created by the current user" do organization_onboarding = create(:organization_onboarding, created_by: @user) - delete "/organizations/onboarding" + delete organization_onboarding_path assert_redirected_to dashboard_path refute OrganizationOnboarding.exists?(id: organization_onboarding.id) @@ -36,14 +36,14 @@ class Organizations::OnboardingControllerTest < ActionDispatch::IntegrationTest should "destroy a failed OrganizationOnboarding created by the current user" do organization_onboarding = create(:organization_onboarding, :failed, created_by: @user) - delete "/organizations/onboarding" + delete organization_onboarding_path assert_redirected_to dashboard_path refute OrganizationOnboarding.exists?(id: organization_onboarding.id) end should "redirect to the dashboarding if the current user has not started organization onboarding" do - delete "/organizations/onboarding" + delete organization_onboarding_path assert_redirected_to dashboard_path end