mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-06 07:29:16 +00:00
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:
committed by
Konrad
parent
f643ba5074
commit
b3acdaf324
@@ -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")
|
||||
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user