Testing js.erb files on rails

I recently looked at the awesome Javascript Blue Ridge testing platform to test javascript on my rails application. But I was wondering if anyone knows how to check javascript view files in rails?

The Blue Ridge structure (as I understand it) allows testing only javascript files. But I wanted to check my "js.erb" files, which also manipulate the DOM.

Does anyone have any ideas?

+3
source share
1 answer

I am using a slightly modified version of these , two functions that I googled, save_fixture and html_for, to save the viewing tools that I load into the tests. To test ajax answers, you can save the response from the answer and then load both the presentation tools and the answers into the test.

I do not use Blue Ridge, I use jasmine / jasmine-jquery. Therefore, I do not know if it has a loadFixtures () function that loads a file for the test, but it is a template.

+2
source

Source: https://habr.com/ru/post/1735258/


All Articles