Skip to main content
Ask A Question
Notifications
You’re not receiving notifications from this thread.
Subscribe

Testing Turbolinks 3 partial replacement

Testing • Asked by Patrick Berarducci

Hey Chris (and everyone else) - Have you played around much with Turbolinks 3 partial replacement? (Chris, I wathed your livecoding segment; was great, thanks.) I'm using it with Rails 4.2.5, and it's working pretty well. My problem is that I can't seem to pick up the partial replacement in my feature tests (using Rspec/capybara/poltergeist). In other words, in my test, I'll visit the page, simulate the event (email entered and button click), and expect the resulting page to include the text from the partial replacement. But the text isn't showing up on the test page. I have js turned on. I couldn't afford to spend a ton of time trying to figure it out, so maybe I missed something. If anyone has any experience with this (e.g., you have or have not gotten tests to work for turbolinks 3 partial-replacement), I'd be interested to hear.

I did some googling and didn't find much on point. I can live without coverage on this for now, but if I can't figure out a testing strategy for partial replacement, I may not use it as much in other parts of the site. I can always resort to js links, react components or just standard page loads.


I just was looking into Turbolinks 5 yesterday and it looks like they've ditched partial replacement because it's sort of trivial gains in comparison to the complexity it adds (their claim) and I kinda agree.

I'm curious, do you know if poltergeist is executing the JS? A previous project I was using ran tests with Firefox and that made it a bit easier to pause and debug what was going wrong with them. Often it was something like that.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 30,005+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.