jejacks0n / teaspoon

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

Using js.coffee.erb with specs #146

Closed powermike closed 10 years ago

powermike commented 10 years ago

Hi,

I want to include ruby value in my spec (ENV vars for instance) but the runner does not play well with it.

I change the suite matcher to this

suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee,js.coffee.erb}"

when I reach the '/specs/default' suite url no file is listed.

If I go the teaspoon root url '/specs', I see my file listed below the "default" suite.

The link is as below:

http://iat-contract.dev/specs/default/?file=%2FUsers%2Fmickael%2FDocuments%2FDiverseo%2Fcode%2Fiat-contract%2Fspec%2Fjavascripts%2Fiat_spec.js.coffee.erb

If I click on it I have this route error:

Started GET "/javascripts/iat_spec.js.coffee.erb.js" for 127.0.0.1 at 2013-12-13 12:03:39 +0100

ActionController::RoutingError (No route matches [GET] "/javascripts/iat_spec.js.coffee.erb.js"):

The only way I have to make it works is to remove the .coffee.erb at the end

http://iat-contract.dev/specs/default/?file=%2FUsers%2Fmickael%2FDocuments%2FDiverseo%2Fcode%2Fiat-contract%2Fspec%2Fjavascripts%2Fiat_spec.js

I hope this helps.

Thank you