Skip to content

Commit

Permalink
Move onboarding controller tests to test/functional
Browse files Browse the repository at this point in the history
These tests fit more with the functional paradigm since they are named
after a controller and test one action at a time.
  • Loading branch information
martinemde committed Dec 4, 2024
1 parent a786900 commit 39644ab
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 39644ab

Please sign in to comment.