jejacks0n / teaspoon

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

Pages with link_to tags appear to fail #388

Closed hlascelles closed 9 years ago

hlascelles commented 9 years ago

We are using link_to tags in our pages, which work fine in development and deployed. But running teaspoon tests we're getting undefined local variable or method for them.

Changing them back to an explicit <a href works fine.

Can I confirm they are supposed to work before I dig deep in the teaspoon code?

jejacks0n commented 9 years ago

That's because fixtures are served by the teaspoon engine. You'd have to prefix your path helpers with your app "mainapp" or something? I don't recall. What you're doing isn't wrong, but it starts to fall into integration tests maybe? Where something like capybara-rspec or cucumber serves you better. Can you explain why you need real links in your fixtures?


Jeremy Jackson

On Jul 7, 2015, at 7:17 AM, hlascelles notifications@github.com wrote:

We are using link_to tags in our pages, which work fine in development and deployed. But running teaspoon tests we're getting undefined local variable or method for them.

Changing them back to an explicit <a href works fine.

Can I confirm they are supposed to work before I dig deep in the teaspoon code?

— Reply to this email directly or view it on GitHub.

hlascelles commented 9 years ago

OK, makes sense. In our case, our body_partial includes our Knockout JS templates - the real ones we use to render views in production. We want to make sure we can bind and manipulate the JS models and have it rendered correctly. As a result, we need real links.

No problem, we only have a few we can hard code them for now... Thanks!