diff --git a/app/components/requester_form_component.html.erb b/app/components/requester_form_component.html.erb index 57cdf8d..d95b398 100644 --- a/app/components/requester_form_component.html.erb +++ b/app/components/requester_form_component.html.erb @@ -1,4 +1,6 @@ <%= form_with(url: @url, class: "requester-form") do |form| %> + <%= form.hidden_field :regulation, value: params[:regulation] %> +
<%= diff --git a/app/controllers/bulk_deletion_requests_controller.rb b/app/controllers/bulk_deletion_requests_controller.rb index 7391c05..e7384f5 100644 --- a/app/controllers/bulk_deletion_requests_controller.rb +++ b/app/controllers/bulk_deletion_requests_controller.rb @@ -20,6 +20,8 @@ def create render(:new, status: :unprocessable_entity) && return end - redirect_to root_path, notice: t(".notice") + redirect_to \ + new_bulk_deletion_request_path(regulation: params[:regulation]), + notice: t(".notice") end end diff --git a/app/models/bulk_deletion_request.rb b/app/models/bulk_deletion_request.rb index bb1b637..1e6cb26 100644 --- a/app/models/bulk_deletion_request.rb +++ b/app/models/bulk_deletion_request.rb @@ -40,11 +40,11 @@ def deliver_emails private - # Generate a deletion request email for each California data brokers. + # Generate a deletion request email for each company. # # @return [void] def generate_emails - Company.california_data_brokers.find_each.with_index do |company, index| + Company.all.find_each.with_index do |company, index| deletion_request = DeletionRequest.new \ company: company, smtp_config: smtp_config, diff --git a/test/integration/deletion_request_flows_test.rb b/test/integration/deletion_request_flows_test.rb index 9cf1a42..fb13e89 100644 --- a/test/integration/deletion_request_flows_test.rb +++ b/test/integration/deletion_request_flows_test.rb @@ -21,7 +21,7 @@ class DeletionRequestFlowsTest < ActionDispatch::IntegrationTest # is correct. assert_emails 1 assert_enqueued_emails 1 - assert_redirected_to root_path + assert_redirected_to new_bulk_deletion_request_path assert_equal "Deletion requests being sent through your SMTP provider. Check your email outbox for confirmation.", flash[:notice] # The rest of the emails should be able to be delivered later.