Forum: Ruby on Rails Can't create a controller test

478d2bd82f5ebeef83e09199115d41a8?d=identicon&s=25 Mark DiSanti (raresanti)
on 2013-10-04 07:16
Hello, I'm very new with Ruby (and Rails), but I need to make a test
with testcase.
I made an application that use openid login (following  Ryan Bates's
tutorial), where the session controller code is:

def create
  if using_open_id?
    open_id_authentication(params[:openid_url])
  ...
  end
end

protected
def open_id_authentication(openid_url)
  authenticate_with_open_id(...) do |result, identity_url, registration|
    if result.successful?
    ...
    end
  end
end

I tried to create a stub with no luck (maybe I don't really know how it
works). I'd like to test the 'authenticate_with_open_id' block,
currently I'm using simplecov to check the coverage and stops in that
line.

Thanks
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.