Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: outbound flow #2

Merged
merged 3 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/components/requester_form_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<%= form_with(url: @url, class: "requester-form") do |form| %>
<%= form.hidden_field :regulation, value: params[:regulation] %>

<div class="requester-form__primary">
<div class="requester-form__field">
<%=
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/bulk_deletion_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions app/models/bulk_deletion_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/deletion_request_flows_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down