jejacks0n / teaspoon

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

How to use custom boot partial? #230

Closed gabrieltomescu closed 10 years ago

gabrieltomescu commented 10 years ago

Hi I'm trying to create a custom boot partial so that I can include some global variables inside Teaspoon. I've created a partial "_boot.html.erb", and placed it inside "spec/javascripts/fixtures".

Here's the contents:

<%= javascript_include_tag *@suite.spec_assets %>
<script>
  alert("Hello!");
</script>

<script type="text/javascript">
  Teaspoon.onWindowLoad(Teaspoon.execute);
</script>

I'm stuck at where to change the config to change the path to this partial. The documentation states "You can use the provided ones or define your own by creating a _boot.html.erb in your fixtures path, and adjust the config to "/boot" for instance."

Where is this config file?

I added this line to teaspoon.rb: image

And when I load my one of the tests I see this: image

jejacks0n commented 10 years ago

sorry I never got around to this.. I assume you figured out that rails displays the paths in which it was looking for the missing partial below the exception.. you should try the partial without the / and see what that does as well -- it's more reasonable.

eugene-ku commented 10 years ago

@gabrieltomescu see https://github.com/modeset/teaspoon/issues/228#issuecomment-46753624