# Problem testing controller

**URL:** <https://discuss.rubyonrails.org/t/problem-testing-controller/67893>\
**Category:** rubyonrails-talk\
**Created:** [October 4, 2013, 5:16am UTC](https://discuss.rubyonrails.org/t/problem-testing-controller/67893 "2013-10-04T05:16:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [October 4, 2013, 5:16am UTC](https://discuss.rubyonrails.org/t/problem-testing-controller/67893/1 "2013-10-04T05:16:39Z")

</div>

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 &nbsp;&nbsp;if using\_open\_id? &nbsp;&nbsp;&nbsp;&nbsp;open\_id\_authentication(params[:openid\_url]) &nbsp;&nbsp;... &nbsp;&nbsp;end end

protected def open\_id\_authentication(openid\_url) &nbsp;&nbsp;authenticate\_with\_open\_id(...) do |result, identity\_url, registration| &nbsp;&nbsp;&nbsp;&nbsp;if result.successful? &nbsp;&nbsp;&nbsp;&nbsp;... &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;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
