Head On

Blog by Marcus Ahnve

RSpec, Autotest and views

The current incarnation of autotest seems to assume that you are using integrated views. If not, you can modify the rspec_rails_autotest.rb file to run the view specs as well:

1 # when %r%^app/views/layouts/(.*)\.rhtml% then
2 #   ["spec/views/layouts/#{$1}_spec.rb"]
3 when %r%^app/views/(.*)\.rhtml$% then
4   ["spec/views/#{$1}_view_spec.rb"]

Your view spec must be postfixed with “_view_spec.rb” for it to work

Update This works out of the box now.

blog comments powered by Disqus