Including angular-scenario.js breaks my Rails Jasmine tests, as in they don't run


I have some Jasmine tests for my (currently) very simple site consisting of a Rails back end and an AngularJS front end. I’m trying to do some Jasmine end-to-end testing, but including angular-scenario.js makes my tests not run. It doesn’t make them fail. It makes them not start at all.

I’m using version 1.0.7, and all the Angular files are from the same version (and all from the official Angular site. The version of Rails I’m using is 3.1.3 with Ruby 1.9.3. I’m also using the jasmine gem version 1.3.2 and jasmine-rails 0.4.5.


  - assets/application.{js,coffee}
  - stylesheets/**/*.css
  - helpers/**/*.{js,coffee}
  - lib/angular-scenario.js
  - '**/*[sS]pec.{js,coffee}'
src_dir: 'app/assets/javascripts'
spec_dir: spec/javascripts


#= require angular.min
#= require angular-mocks


describe 'test', () ->
  it 'works', () ->

Of course, that’s just a placeholder until I can get the test work correctly with angular-scenario.js in place.

Without angular-scenario.js, the tests run. With it, nothing.

To test, I typically run RAILS_ENV=test rake spec:javascript, but I’ve also tried from the web server interface.

The output without angular-secnario.js:


1 spec, 0 failures in 0.005s.

ConsoleReporter finished

The output with angular-scenario.js:


0 specs, 0 failures in 0s.

ConsoleReporter finished

Things I’ve tried:

  • Moving angular-scenario.js to vendor/assets/javacripts and requiring it from
  • Removing either other Angular-related requirement from
  • angular-scenario.js comes with jQuery packaged with it. Commenting out the jQuery bit, oddly enough, makes the tests run, though they fail because angular-scenario needs jQuery, apparently. I also tried commenting out the jQuery in angular-scenario and including jQuery from the jquery-rails gem. (That was a shot in the dark. I didn’t think that would actually work.)

Thank you very much to whoever wants to take a swing at this one.


Jasmine and angular-scenario.js (e2e runner) are two different things and they should be run separately. Angular e2e test framework uses syntax which is very similar to jasmine. Probably when you include it along with jasmine it overrides some jasmine’s methods like describe, it and beforeEach.

Answered By – luacassus

Answer Checked By – Pedro (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.