jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

How to load templates? #228

Closed sporto closed 10 years ago

sporto commented 10 years ago

Our application uses mustache templates for rendering views. At the moment these templates are added in our application.html layout file so they are available for the JS.

We have all our templates in app/views/templates, then in application.html we have a view helper that dumps all those templates there. So it seems we need some way of including this same helper in the teaspoon page.

How can we make these templates available to teaspoon?

eugene-ku commented 10 years ago

use boot partials:

test/javascripts
├── fixtures
│   ├── _body.html.erb
│   └── _boot.html.erb
├── support
│   └── ember-qunit.js
└── test_helper.coffee
# teaspoon_env.rb 
suite.boot_partial = "/boot"

copy these files manually or via '--partials' flag during install from $(dirname $(gem which teaspoon))/../app/views/teaspoon/suite/

jejacks0n commented 10 years ago

thanks. I'll update the docs for this.