testdouble / jasmine-rails

A Jasmine runner for rails projects that's got you covered in both the terminal and the browser
http://rubygems.org/gems/jasmine-rails
MIT License
378 stars 154 forks source link

SpecRunner precompiles assets? #168

Closed BroiSatse closed 9 years ago

BroiSatse commented 9 years ago

Hi. I am having an issue with SpecRunner loading angular-mocks twice when running tests from the terminal (and this is causing infinite loop). Everything works very nicely when running through the mounted engine though.

In a spec file I have sprocket command #= require angular-mocks. When I remove it, I have no access to angular mocks, however when it is there it's causing this file to be loaded twice. After some digging, I managed to find a difference between runner.html and /specs pages - runner.html is using precompiled version of Spec file (with a angular-mocks file content included within it) together with angular-mock file itself. How can I stop it from doing this?

I have created a simple application to reproduce the issue: https://github.com/BroiSatse/angular-jasmine-error. localhost:3000/specs works as charm, rake spec:javascript gets an infinite loop.

searls commented 9 years ago

Try RAILS_ENV=test rake spec:javascript. I believe this is a dupe of #121. Could you look at helping finish #162 to resolve this?

BroiSatse commented 9 years ago

Changing rails environment works. Thank you very much. I'll have a look at #162 in the evening. Again, thanks for help. :+1: