Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Mac Martine's Profile

GitHub User: macmartine

Site: http://macmartine.com

Comments by Mac Martine

Avatar

What about testing controllers directly? Do you not do that? I am finding almost no examples of this, except for verifying which template is rendered.

Avatar

I assume this should work with javascript? Javascript isn't executed in my test runs, though it works fine in the browser. When my tests submits a form with :remote => true, I get the error"Unable to find xpath "/html"" and the page is blank when I call save_and_open_page. Any ideas? I tried :selenium and :webkit drivers.

Avatar

Doh, nevermind, I got it. The stylesheets paths have to be relative. Thanks again!

Avatar

Thanks Ryan. This doesn't seem to work when the emails are sent via Resque. Should it still work?

Avatar

You can do this in Rails 3.1 by using the pre-processor chaining. I removed the Javascripts controller, moved the js.erb file into the asset pipeline, and instead of accessing controller variables I just made new queries from within there.

Avatar

+1 for getting a hint on how to do this in Rails 3.1