# How can I improve the isolation for this controller spec?

So I'm doing things the BDD way, writing features first, then moving on to writing specs to add more detail to the mix as I move down the layers.

One thing that bothered me, but isn't a big problem, is that when I got to the controller part of the stack, I have calls to the User and Todo model in my controller spec.

Is this okay and normal? Or should I be stubbing these things out?

describe TodosController do
let(:user) { Factory(:user) }

describe "post 'create'" do
lambda {
post :create
}.should change(user.todos, :count).by(1)
end
end

• FWIW: A number of people have moved away from speccing controller actions to covering them with Cucumber stories. Like: Dec 17, 2011 at 2:26