Skip to content

Instantly share code, notes, and snippets.

@tvandervossen
tvandervossen / test_http_digest_rails3_patch.rb
Created May 21, 2012 19:34 — forked from denisahearn/test_http_digest_rails3_patch.rb
Testing HTTP Digest Authentication in Rails 3
# Add this to test/test_helper.rb
# Allow http digest authentication in functional tests, based on https://gist.github.com/1282275
# Call authenticate_with_http_digest(user, realm, digest) or authenticate_with_http_digest(user, realm, password, false) before you perform a request
class ActionController::TestCase
require 'digest/md5'
def authenticate_with_http_digest(user, realm, password, password_is_ha1 = true)
ActionController::Base.class_eval { include ActionController::Testing }
class DOMNodeList
include Enumerable
def each
length.times { |i| yield item(i) }
end
end
doc = webView.mainFrameDocument
p document.querySelector('meta[name=viewport][content*=width]')
Fingertips is a high-end design and development team for web, iPhone, iPad, and Mac OS X.