testing - Using gon with jasmine-rails -


our backbone app uses gon. when try run our tests, getting gon undefined error in console of browser. our layout file includes call include_gon, file not being loaded jasmine, jasmine failing in our first javascript file contains gon. tried creating helper assign gon variable empty hash (like fixture), helper called after first call gon , therefore didn't fix our issue.

the secret use asset pipeline define load order of files. commented out these lines jasmine.yml

# path parent directory of src_files # relative path rails.root # defaults app/assets/javascripts #src_dir: "app/assets/javascripts"  # list of file expressions include source files # relative path src_dir #src_files: #  - "application.{js.coffee,js,coffee}" 

and created spec.js.coffee these lines:

#= require application #= require jasmine-jquery 

now js files loaded in order , go.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -