diff --git a/app/views/admin/_terms_of_service_banner.html.haml b/app/views/admin/_terms_of_service_banner.html.haml index 30d252467c..f661015a45 100644 --- a/app/views/admin/_terms_of_service_banner.html.haml +++ b/app/views/admin/_terms_of_service_banner.html.haml @@ -3,6 +3,6 @@ .column-left %p= t("admin.terms_of_service_have_been_updated_html", tos_link: link_to(t("admin.terms_of_service"), TermsOfServiceFile.current_url, target: "_blank")) .column-right - %button{ data: { reflex: "click->Enterprise::User#accept_terms_of_services", id: current_spree_user&.id } } + %button{ data: { reflex: "click->Enterprise::User#accept_terms_of_services" } } = t("admin.accept_terms_of_service") diff --git a/spec/reflexes/enterprise/user_reflex_spec.rb b/spec/reflexes/enterprise/user_reflex_spec.rb index b70f01321d..67a4cbb1ab 100644 --- a/spec/reflexes/enterprise/user_reflex_spec.rb +++ b/spec/reflexes/enterprise/user_reflex_spec.rb @@ -7,14 +7,10 @@ describe Enterprise::UserReflex, type: :reflex do let(:context) { { url: spree.admin_dashboard_url, connection: { current_user: } } } describe "#accept_terms_of_services" do - subject(:reflex) do - build_reflex( - method_name: :accept_terms_of_services, **context, params: { id: current_user.id } - ) - end + subject(:reflex) { build_reflex(method_name: :accept_terms_of_services, **context) } it "updates terms_of_service_accepted_at" do - expect{ + expect { reflex.run(:accept_terms_of_services) current_user.reload }.to change{ current_user.terms_of_service_accepted_at }