diff --git a/app/controllers/onboarding_controller.rb b/app/controllers/onboarding_controller.rb index 8115bf8..380ef66 100644 --- a/app/controllers/onboarding_controller.rb +++ b/app/controllers/onboarding_controller.rb @@ -22,7 +22,7 @@ class OnboardingController < ApplicationController private def onboarding_params - params.require(:user).permit(:first_name, :last_name, :company_name) + params.require(:user).permit(:first_name, :last_name) end def onboarding_params_valid? diff --git a/app/javascript/controllers/toggle_section_controller.js b/app/javascript/controllers/toggle_section_controller.js deleted file mode 100644 index 4eda2e5..0000000 --- a/app/javascript/controllers/toggle_section_controller.js +++ /dev/null @@ -1,25 +0,0 @@ -import { Controller } from "@hotwired/stimulus" - -// Connects to data-controller="toggle-section" -export default class extends Controller { - static targets = ["section", "icon"] - - connect() { - // Ensure the section starts hidden - this.sectionTarget.classList.add("hidden") - } - - toggle() { - const isHidden = this.sectionTarget.classList.contains("hidden") - - if (isHidden) { - // Show the section - this.sectionTarget.classList.remove("hidden") - this.iconTarget.classList.add("rotate-180") - } else { - // Hide the section - this.sectionTarget.classList.add("hidden") - this.iconTarget.classList.remove("rotate-180") - } - } -} \ No newline at end of file diff --git a/app/views/onboarding/index.html.erb b/app/views/onboarding/index.html.erb index 22b8e67..a7d57f7 100644 --- a/app/views/onboarding/index.html.erb +++ b/app/views/onboarding/index.html.erb @@ -63,40 +63,6 @@ - -
- - - - -
-

Informations professionnelles

- -
- <%= form.label :company_name, "Nom de l'entreprise", class: "block text-sm font-medium text-gray-700 mb-2" %> - <%= form.text_field :company_name, - value: current_user.company_name, - class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition-colors", - placeholder: "Nom de votre entreprise" %> -

- Cette information peut être utile si vous organisez des événements professionnels. -

-
-
-
diff --git a/test/controllers/onboarding_controller_test.rb b/test/controllers/onboarding_controller_test.rb index 6a878f1..5b6c2bf 100644 --- a/test/controllers/onboarding_controller_test.rb +++ b/test/controllers/onboarding_controller_test.rb @@ -18,7 +18,7 @@ class OnboardingControllerTest < ActionDispatch::IntegrationTest sign_in @user_without_onboarding get onboarding_path assert_response :success - assert_select "h1", "Bienvenue sur AperoNight !" + assert_select "h1", /Bienvenue sur.*!/ assert_select "form" end @@ -36,8 +36,7 @@ class OnboardingControllerTest < ActionDispatch::IntegrationTest post complete_onboarding_path, params: { user: { first_name: "Jane", - last_name: "Smith", - company_name: "Test Company" + last_name: "Smith" } } @@ -49,23 +48,6 @@ class OnboardingControllerTest < ActionDispatch::IntegrationTest assert @user_without_onboarding.onboarding_completed? assert_equal "Jane", @user_without_onboarding.first_name assert_equal "Smith", @user_without_onboarding.last_name - assert_equal "Test Company", @user_without_onboarding.company_name - end - - test "should complete onboarding without optional company name" do - sign_in @user_without_onboarding - - post complete_onboarding_path, params: { - user: { - first_name: "Jane", - last_name: "Smith", - company_name: "" - } - } - - assert_redirected_to dashboard_path - @user_without_onboarding.reload - assert @user_without_onboarding.onboarding_completed? end test "should not complete onboarding without required fields" do