Where to define Global proxy/redirection system for example.com

14 views
Skip to first unread message

Luc Delmon

unread,
Mar 16, 2023, 8:29:57 AMMar 16
to Capybara
Hello all :),

I have this little bloc of code

url = URI.parse(page.current_url) 
if url.host == "example.com
  visit("#{url.path}?#{url.query}") 
end

That I can use in a page to handle external callback (from payment provider for example).
The payment provider cannot callback my localhost so I give him a callback url with the default rspec host 'example.com' and then catch and redirect the call to my localhost.

The code works very well but I have to trigger it directly in my test where it happens.

I was wondering if there was a way to generalize it (so this bloc is executed everytime  the url is changing in the navigor )

I couldn't find anything in the doc nor in this google group.

Thanks in advance if you have an idea
Reply all
Reply to author
Forward
0 new messages