Why Capypara + Rspect Tests Still Pass Even Though I Delete Application.Js File

Why Capypara + Rspect tests still pass even though I delete application.js file?

Try with

rake assets:clobber

This will remove compiled assets and clean them.

Rails 5 Capybara Test Routing Error public/assets

I changed this confid in test.rb and worked:

config.assets.prefix = '../public/assets/'

to

config.assets.prefix = ''

Rspec/capybara requests failing to see page content

Today (over a month later) I realized what was causing the problem- an incorrect HTML comment. When I experiment with things, I usually comment out the experiments instead of deleting them, so it was bound to happen again, but this time it was easier to spot.

Correct comment:
<!-- commented-out HTML -->

Incorrect comment:
<!-- commented-out HTML --!>

That second ! at the end of the incorrect comment was causing the comment to not be closed properly. My text editor didn't care, and my browser seemed to be rendering everything the same, but in my case, capybara wasn't reading past it.

Kind of embarrassing, but at least I know now.



Related Topics



Leave a reply



Submit