Created
November 9, 2012 10:28
-
-
Save tombruijn/4045037 to your computer and use it in GitHub Desktop.
Konacha testing setup for output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/javascripts/templates/hello.jst.eco | |
<h1>Hello <%= @name %>!</h1> | |
# Eco uses instance variables for variables given by the test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/javascripts/my_test_spec.js.coffee | |
#= require spec_helper | |
describe "templating", -> | |
it "is built in to Sprockets", -> | |
$('body').html(JST['templates/hello']({ name: '80beans' })) # name becomes instance variable | |
$('body h1').text().should.equal('Hello 80beans!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment