jejacks0n / teaspoon

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

inbrowser test inside mountable engines #214

Closed agenteo closed 10 years ago

agenteo commented 10 years ago

I was reding:

https://github.com/modeset/teaspoon/wiki/Testing-Engine-Assets

and I was able to rake teaspoon run the calculator test without problems (except the minor one tracked on https://github.com/modeset/teaspoon/issues/213).

Then I decided to test the teaspoon in-browser testing from dummy app. The reason is to have a JS console to help inbrowser debugging (similar to what jasmine provides). I tried to run rails s from my engine dummy app and /teaspoon was available (with a minor adjustment, adding teaspoon-teaspoon.js to issue 213 list).

When I go to: http://localhost:3000/teaspoon/default

Looks like the specs (currently in my engine root) aren't available.

So I moved them inside the dummy app's spec/javascript folder and both the rake task and the inbrowser test (http://localhost:3000/teaspoon/default) worked.

Is the inbrowser not meant to be supported from within an engine? Can you see any downsides in creating the specs in the dummy app spec/javascript?

Cheers

jejacks0n commented 10 years ago

note how https://github.com/modeset/teaspoon/blob/master/spec/teaspoon_env.rb looks with the require at the top.

and how https://github.com/modeset/teaspoon/blob/master/spec/dummy/config/boot.rb points to the gemfile in the root path.

In general teaspoon is a good example of how to set that up, because that's how it's setup. Feel free to update the wiki if you find that anything has changed.