RSpec, Autotest and views

Date:

Tags:

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:

:::ruby

# when %r%^app/views/layouts/(.*)\.rhtml% then
#   ["spec/views/layouts/#{$1}_spec.rb"]
when %r%^app/views/(.*)\.rhtml$% then
  ["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.