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
1 change: 1 addition & 0 deletions app/controllers/accounts/connected_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class ConnectedAccountsController < ApplicationController
layout 'account_side_nav'

def show
analytics.connected_accounts_page_visited
@presenter = AccountShowPresenter.new(
decrypted_pii: nil,
sp_session_request_url: sp_session_request_url_with_updated_params,
Expand Down
5 changes: 5 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ def concurrent_session_logout
track_event(:concurrent_session_logout)
end

# User visits the connected accounts page
def connected_accounts_page_visited
track_event(:connected_accounts_page_visited)
end

# @param [String] redirect_url URL user was directed to
# @param [String, nil] step which step
# @param [String, nil] location which part of a step, if applicable
Expand Down
21 changes: 21 additions & 0 deletions spec/controllers/accounts/connected_accounts_controller_spec.rb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this spec file 🙌

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Accounts::ConnectedAccountsController do
describe '#show' do
let(:user) { create(:user, :fully_registered) }

before do
stub_sign_in(user) if user
end

it 'shows and logs a visit' do
stub_analytics

get :show

expect(@analytics).to have_logged_event(:connected_accounts_page_visited)
end
end
end