Remove user.id parameter

It's not needed, as the reflex get the curent user based on the user
session
This commit is contained in:
Gaetan Craig-Riou
2023-11-24 09:41:25 +11:00
committed by Konrad
parent f643ba5074
commit b3acdaf324
2 changed files with 3 additions and 7 deletions

View File

@@ -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")

View File

@@ -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 }