Skip to content

Instantly share code, notes, and snippets.

View boblin's full-sized avatar

Bohuslav Blín boblin

  • Prague, Czech Republic
View GitHub Profile
### Keybase proof
I hereby claim:
* I am boblin on github.
* I am boblin (https://keybase.io/boblin) on keybase.
* I have a public key ASBXWqrJhVLneqqTkK1RtHsKXFSBhxt8zkOWbpEzKk1qhwo
To claim this, I am signing this object:
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@boblin
boblin / open_id_authentication_mock.rb
Created March 27, 2009 10:16
shoulda + webrat + authlogic (+ OpenID)
# originaly from: http://209.85.129.132/search?q=cache:xI4xvFsZlWgJ:www.northpub.com/articles/2007/04/02/testing-openid-support+rails+mocks&cd=3
module OpenIdAuthentication
protected
def authenticate_with_open_id(identity_url = params[:openid_url], fields = {}) #:doc:
# identity_url = normalize_url(identity_url)
if User.find_by_openid_identifier(identity_url)
yield Result[:successful], identity_url
else