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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.