RSpec controller testing – blank response.body

By default, rspec-rails hacks into Rails to prevent it from actually rendering view templates. You should only test the behavior of your actions & filters your controller tests, not the outcome of template rendering — that’s what view specs are for.

However, if you wish to make your controller specs render templates as the app normally would, use the render_views directive:

describe YourController do
  render_views
  ...
end

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)