Closed asenamdsol closed 8 years ago
Yeah, this isn't possible or feasible. Jasmine is designed for unit testing, and your erb processing will happen outside the context of your traditional application server (e.g. Ivars set in your controllers won't be set). This isn't supported
On Feb 19, 2016, at 5:15 PM, Anthony Sena notifications@github.com wrote:
Hello,
I am attempting to test functions in the app/assets/javascripts/application.js.erb file. The spec runs fine, and the function I am attempting to test is found. The problem is, because it is an erb file, there are variables being used that are not rendered. I had assumed that because the applications.js.erb file is in the asset pipeline and the server is running that any variables used would be rendered. Is it even possible to do what I am attempting?
Thanks
— Reply to this email directly or view it on GitHub.
Thanks for the reply. Looked all day for a solution. Tired of banging my head against the wall.
Hello,
I am attempting to test functions in the app/assets/javascripts/application.js.erb file. The spec runs fine, and the function I am attempting to test is found. The problem is, because it is an erb file, there are variables being used that are not rendered. I had assumed that because the applications.js.erb file is in the asset pipeline and the server is running that any variables used would be rendered. Is it even possible to do what I am attempting?
Thanks