On Thu, Sep 13, 2012 at 9:18 AM, Tom Hughes <span dir="ltr"><<a href="mailto:tom@compton.nu" target="_blank">tom@compton.nu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">I would certainly like to be able to get our javascript under test - my concern is to find a way to do so that is compatible with my workflow.</div>
<br>
Reading the Konacha documentation it seems that it exists entirely outside the normal rails testing framework, and has to be run separately so this would have no affect on "rake test" right? </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
That's both good, in that it doesn't break anything I do now, and bad in that it means I have to do something extra if I want to test the js code before I deploy.<br></blockquote><div><br></div><div>That's correct. What I typically do is add the `konacha:run` rake task (which is a fully-automated command-line runner) as a dependency of the task used for CI. Then the JS tests run in CI, and if I want to run the full suite locally, I can use the CI task. Otherwise I'm usually doing iterative test/develop cycles using `konacha:serve` and a browser.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What I absolutely don't want is anything that causes browser windows to start appearing when I run the tests.<br></blockquote><div><br></div><div>`konacha:run` can be configured to use a headless Capybara driver such as capybara-webkit, and in that configuration it won't pop up anything. `konacha:serve` is like `rails server` -- you open the test runner page at your own leisure.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also, from the Konacha documentation it sounds like it is mostly for unit testing of small pieces of javscript rather than testing that pages actually work properly and do what we want right?</blockquote><div><br></div><div>

That's correct. It's intended for unit-level tests, and not full-stack integration tests. Capybara (with the rack-test or a headless driver, if that's your preference) is a better choice for that.</div></div>