Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Demo app for the JasmineCoffee CodeTV screencast

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 log
Octocat-spinner-32 public
Octocat-spinner-32 script
Octocat-spinner-32 spec
Octocat-spinner-32 test
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 Rakefile


The client-side of your application deserves some tests too. In this episode we'll look at how to use the Jasmine testing framework with CoffeeScript inside of Rails.


gemfile add

group :development, :test do
  gem 'evergreen', require:'evergreen/rails'

run bundle to install

$ bundle

see new evergreen rake command

$ rake -T spec

Run JavaScript specs via Evergreen

$ rake spec:javascripts

Create folder for tests

$ mkdir -p spec/javascripts
$ touch spec/javascripts/

Add this to

describe 'A Calculator', ->
  it 'should add two numbers', ->
  result = myApp.Calculator.add(2,3)

Run test again

$ rake spec:javascripts

Start evergreen server

$ evergreen serve

Add to spec/javascripts/

myApp = {}
myApp.Calculator = {
  add: (a,b) -> a + b

Setup guitar app and Tests

In order to setup the app locally, first run bundle to install dependencies. Then, run bundle exec rake db:create db:migrate db:test:prepare to setup you database. To run the test suite including Jasmine specs, run bundle exec rake.

Something went wrong with that request. Please try again.