Skip to content
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
4 changes: 2 additions & 2 deletions app/controllers/users/delete_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def show
end

def delete
irs_attempts_api_tracker.account_purged(success: true)
irs_attempts_api_tracker.logged_in_account_purged(success: true)
send_push_notifications
delete_user
sign_out
Expand All @@ -31,7 +31,7 @@ def confirm_current_password

flash[:error] = t('idv.errors.incorrect_password')
analytics.account_delete_submitted(success: false)
irs_attempts_api_tracker.account_purged(success: false)
irs_attempts_api_tracker.logged_in_account_purged(success: false)
render :show
end

Expand Down
18 changes: 9 additions & 9 deletions app/services/irs_attempts_api/tracker_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
# rubocop:disable Metrics/ModuleLength
module IrsAttemptsApi
module TrackerEvents
# @param [Boolean] success True if Account Successfully Deleted
# A User deletes their Login.gov account
def account_purged(success:)
track_event(
:account_purged,
success: success,
)
end

# @param [Boolean] success True if Account Successfully Deleted
# @param [Hash<Key, Array<String>>] failure_reason displays why account deletion failed
# A User confirms and deletes their Login.gov account after 24 hour period
Expand Down Expand Up @@ -359,6 +350,15 @@ def idv_verification_submitted(
)
end

# @param [Boolean] success True if Account Successfully Deleted
# A User deletes their Login.gov account
def logged_in_account_purged(success:)
track_event(
:logged_in_account_purged,
success: success,
)
end

# @param [Boolean] success True if the password was successfully changed
# @param [Hash<Symbol,Array<Symbol>>] failure_reason
# A logged-in user has attempted to change their password
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/users/delete_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
expect(@analytics).to receive(:track_event).
with('Account Delete submitted', success: false)
expect(@irs_attempts_api_tracker).to receive(:track_event).
with(:account_purged, success: false)
with(:logged_in_account_purged, success: false)

delete
end
Expand All @@ -70,7 +70,7 @@
expect(@analytics).to receive(:track_event).
with('Account Delete submitted', success: true)
expect(@irs_attempts_api_tracker).to receive(:track_event).
with(:account_purged, success: true)
with(:logged_in_account_purged, success: true)

delete
end
Expand Down