On Thu, Oct 16, 2008 at 9:49 AM, Jim Gay <[EMAIL PROTECTED]> wrote: > > Because you are creating an expectation for the following action. > In your code above, you are doing the action, and then creating an > expectation for a following action which never occurs, so it receives it 0 > times following that expectation.
This confused me too at first. To put it another way: (1) controller.expect_render(:layout => 'index') [set expectation] (2) get :index [perform action] ...is equivalent to... (1) Call spouse to say "Honey, I'm coming home, see you shortly." (2) Go home and kiss spouse. Putting the "get" first and then setting the "expect" would be equivalent to: (1) Go home and kiss spouse. (2) Call spouse to say "Honey, I'm coming home, see you shortly." Your spouse's natural reaction would be "Ummmm...." Which is basically what RSpec is telling you by that error message when you do the 'get' then the 'expect.' -- Have Fun, Steve Eley ([EMAIL PROTECTED]) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users