Pain free acceptance testing of CoffeeScript applications with Rails 3.1+
Ruby CoffeeScript
Latest commit 236bb26 Apr 14, 2012 Dominik Guzei updates readme

Jasmine Stories: Story driven development with Jasmine

Utilizing Jasmine with the addition of Jasmine-species and taking full advantage of the Rails 3.1 asset pipeline. jasmine-stories removes any excuse YOU have for not testing your out of control application.

This project rocks, is a shameless "fork" of jasminerice and uses the MIT-LICENSE.

Headless Testing

See guard-jasmine for details.

guard-jasmine is configured for jasminerice by default. You have to provide the special url of jasmine-stories on the command line: guard-jasmine -u


This is a gem specifically for Rails 3.1. Just include it in your Gemfile:

group :development, :test do
  gem "jasmine-stories"

The engine is automatically mounted into your application in the development and test environments. If you'd like to change that behavior, you can override the array JasmineStories.environments in an initializer.



Create a file spec/javascripts/ with the following content:

#=require_tree ./stories

This pulls in all your specs from the javascripts/stories directory into Jasmine:


The Rails 3.1 asset pipeline using Sprockets and Tilt ensure conversion.

As well you can use the #require dependency mechanisms in your specs to pull dependencies. Here's an example spec/javascripts/

#= require foo
#= require bar

feature "Requiring classes with sprockets", ->

    'In order to use classes in my specs',
    'As a user',
    'I want to require them with sprockets'

  scenario "Require foo and bar", ->

    foo = bar = null

    Given "I have required foo and bar", ->
      foo = new Foo()
      bar = new Bar()

    When "I tell foo to jump", ->

    Then "bar should have jumped too", ->
      (expect bar.jumped).toBe true


For including stylesheets in your specs, Jasminerice uses spec/javascripts/spec.css. Use Sprockets directives to include the right css files:

 *= require application

Start server

Now start your server

rails s



and there are your acceptance tests.