jejacks0n / teaspoon

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

Is there a way to include a helper into the erb fixture generation? #244

Closed nathanpalmer closed 9 years ago

nathanpalmer commented 10 years ago

We're trying to share a partial between the tests and our application like this

<%= render "shared/user" %>

However that particular partial uses some methods from our ApplicationHelper.

jejacks0n commented 9 years ago

You can add your own "fixture" controller, and do whatever you like -- since it's running the rails server next to the teaspoon suite, you can feel free to load whatever you want, wherever it exists, and then request that via ajax -- though you may have to provide your own routes and controller to achieve that.

I believe the fixtures do allow loading things from a different paths, but if it doesn't, you're free to load things via ajax however you feel appropriate -- teaspoon just provides a consistent and easy to document structure for this, but doesn't have to be used.