controller
RSpec View testing: Mocking helpers vs. mocking controller methods
Wolfram Arnold — Tue, 05/12/2009 - 01:35
RSpec::Rails (I'm using version 1.2.2 as of this writing) has a really cool feature to test view templates. This is one of the features where RSpec really has a leg up on standard Rails functional tests.
You can test the view templates without the controller actions running, which has the nice side-effect that your actions and your views become less tightly coupled—and you're doing BDD, right?
Here is an example of testing a layout, you can do this without even relating to an action or a view template:
describe 'layouts/application' do
before(:each) do


