Reputation: 21
I'm testing a feature using Cucumber and Capybara (with poltergeist/phantomjs). The problem is that changes that I make to my code are not being reflected in the tests. My tests are failing because I changed the name of a link, if I take a screenshot of the page on the test I can see that it still shows the old link, but if I navigate to the page on my browser, it shows the correct one. I have been trying to solve this since yesterday with no luck. I don't even know which code would be relevant to paste here, has anyone had this problem or has any idea of what this could be?
Thank you!
I was able to fix this by running rails generate cucumber:install
again. Doing this updated the page on the test. But then I modified the page again and once more it's outdated on the test, running the cucumber:install
command is not helping anymore either.
Upvotes: 2
Views: 185
Reputation: 701
You should run rake assets:precompile RAILS_ENV=test
and that will regenerate the code that capybara will run.
Upvotes: 0