[rspec-users] nuby: how spec redirect_to at ApplicationController
court3nay at gmail.com
Wed Aug 15 16:30:04 EDT 2007
On 8/15/07, Priit Tamboom <priit.tamboom at gmail.com> wrote:
> Good morning rspec people!
> Still rspec nuby: I must do something wrong obviously.
> How can I spec about redirect_to at ApplicationController
> describe ApplicationController do
> it "method login_required should redirect to home path without login" do
heh. "it" is so out of place here :)
> pending "I tried to use
> controller.login_required.should be_redirected
> and got NoMethodError with nil object didn't expect error."
> class ApplicationController < ActionController::Base
> # using it with before_filter
> def login_required
> # I took out everything except redirecting to make the point simple
> redirect_to home_path # tried also redirect_to "/"
> However the code does work manually testing with browser.
> Thanks for any help,
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users