LG-7184: Add analytics to security & privacy link on welcome and agreement steps#8342
LG-7184: Add analytics to security & privacy link on welcome and agreement steps#8342
Conversation
changelog: Internal, Identity verification, Add analytics to clicks on security/privacy link early in the funnel.
| allow(view).to receive(:url_for).and_wrap_original do |method, *args, &block| | ||
| method.call(*args, &block) | ||
| rescue | ||
| '' | ||
| end |
There was a problem hiding this comment.
Why is this needed? Is there a way to test the code change more directly by making assertions about what FakeAnalytics receives?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
soniaconnolly
left a comment
There was a problem hiding this comment.
LGTM (for code constrained by the FSM)
🎫 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
RedirectControllerto start collecting analytics.