[rspec-users] noob question for getting true or false from a function
dchelimsky at gmail.com
Tue Apr 29 02:06:17 EDT 2008
On Apr 29, 2008, at 12:59 AM, Patrick Aljord wrote:
> Hey all,
> I have an action that looks like this:
> def create
> if using_open_id?
> password_authentication(params[:email], params[:password])
> I have a spec that looks like this:
> it "should login and redirect" do
> post :create, :email => "foo at bar.com", :password => "test"
> <here goes the code that says that using_open_id? must return
> session[:user_id].should_not be(nil)
> response.should be_redirect
> any idea how to make this work so that using_open_id? returns false?
> For now I get "undefined method `using_open_id?' for
> #<SessionsController>". I don't want to write a test for
> using_open_id? cause it comes with the open_id_authentication plugin.
More information about the rspec-users