[rspec-users] rspec_on_rails: controller method not getting called
cnantais at gmail.com
Thu Sep 27 15:29:20 EDT 2007
I figured it out.
By doing this session sanity check in the spec (as recommended by
sess = session
I was able to see that a 'Please log in' redirect was preventing index from
> In my rspec_on_rails controlle rspec, I have this:
> require File.dirname(__FILE__) + '/../spec_helper'
> describe FooController, "with a foo" do
> it "should be false" do
> get 'index'
> assigns[:foo].should be_false
> In my controller I have this:
> class FooController < ApplicationController
> def index
> @foo = FALSE
> But the result of running the spec is:
> 'FooController should be false' FAILED
> expected false, got nil
> It seems I can give any argument to `get`in the description and it won't
> complain that the method is missing, so I suppose this means that the
> `get` in the description is not calling my 'index' method. Any advice?
> I'm using the latest RSpec and rspec_on_rails, ruby 1.8.6, Rails 1.2.3.
View this message in context: http://www.nabble.com/rspec_on_rails%3A-controller-method-not-getting-called-tf4530269.html#a12928446
Sent from the rspec-users mailing list archive at Nabble.com.
More information about the rspec-users