When testing, do I have to pre-assemble the assets every time I configure Javascript files in Rails 3.2?

I am trying to learn TDD and BDD and do it right. The stack that I use (or try to use, Spork does not work with Guard for me) is Minitest-Guard-Spork-Capybara. I focus on Unit Tests for models and specifications for integration tests.

There are a lot of Ajax in this application. I just did save_and_open_pageone of my tests, and of course the page looked awful because it could not find any of the assets.

My question is, should I test JS functionality, do I need to precompile the assets every time to check them, or is there some way that the default mode for dev is for testing purposes.

I am sure this is a question of n00b, but the one where I am testing. Trying to do it right.

+5
source share
2 answers

You do not need to collect assets, in fact you do not need to do anything at all. save_and_open_page works differently and doesn’t load your assets, so don’t be afraid if everything looks ugly, your capybara tests still work fine with javascript without any changes to the setup of the test environment.

capybara - javascript, , javascript.

+2

, . ( ?), . config.assets.compile = true.

+3

All Articles