Skip to content

LG-7184: Add analytics to security & privacy link on welcome and agreement steps#8342

Merged
matthinz merged 2 commits intomainfrom
matthinz/7184-privacy-analytics
May 5, 2023
Merged

LG-7184: Add analytics to security & privacy link on welcome and agreement steps#8342
matthinz merged 2 commits intomainfrom
matthinz/7184-privacy-analytics

Conversation

@matthinz
Copy link
Contributor

@matthinz matthinz commented May 4, 2023

🎫 Ticket

LG-7184

🛠 Summary of changes

Updates the "Learn more about our privacy and security measures" links on the welcome and agreements steps of IDV to run through our RedirectController to start collecting analytics.

matthinz added 2 commits May 4, 2023 15:14
changelog: Internal, Identity verification, Add analytics to clicks on security/privacy link early in the funnel.
@matthinz matthinz requested a review from a team May 4, 2023 22:17
Comment on lines +9 to +13
allow(view).to receive(:url_for).and_wrap_original do |method, *args, &block|
method.call(*args, &block)
rescue
''
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? Is there a way to test the code change more directly by making assertions about what FakeAnalytics receives?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case it's just a view test, and the redirect / analytics code already has tests elsewhere. What I want to test here is that the view contains the link I think it should contain.

These step views use url_for in wiring up their SimpleForms. This ends up throwing No route matches {:action=>"agreement", :controller=>"idv/doc_auth"} during the view spec -- I'm not sure why (I assume FSM???).

The existing spec for the welcome view gets around this by mocking url_for to always return "https://www.example.com". However, I'm trying to test code that uses the policy_redirect_url helper, which looks like it uses url_for under the hood, so I need that code to actually return the original, but I don't really care about the url_for call used by SimpleForm.

Agree this is weird, and would love to know why url_for is throwing but I think I might be out of ideas.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm willing to dig into this with you, and also willing to trust that you landed on a good answer in the circumstances. Let's revisit post-FSM!

Copy link
Contributor

@soniaconnolly soniaconnolly left a comment

Choose a reason for hiding this comment

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

LGTM (for code constrained by the FSM)

@matthinz matthinz merged commit b760009 into main May 5, 2023
@matthinz matthinz deleted the matthinz/7184-privacy-analytics branch May 5, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants