This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A user session class, a simplified mix of the following code samples: | |
# * https://github.com/blog/1661-modeling-your-app-s-user-session | |
# * http://www.jonathanleighton.com/articles/2013/revocable-sessions-with-devise/ | |
class Session < ActiveRecord::Base | |
# Uncomment if you use Hobo Fields, else add these yourself | |
# fields do | |
# session_id :string, :index => true, :unique => true | |
# accessed_at :datetime | |
# user_ip :string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails 3.2 support for HTTP PATCH. | |
fail "Remove this patch" if Rails::VERSION::MAJOR > 3 | |
# see http://weblog.rubyonrails.org/2012/2/26/edge-rails-patch-is-the-new-primary-http-method-for-updates/ | |
# https://github.com/rails/rails/pull/505 | |
# Be very conservative not to monkey-patch any methods until | |
# the relevant files are loaded. | |
ActiveSupport.on_load(:action_controller) do | |
ActionDispatch::Request.instance_eval do | |
# Is this a PATCH request? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'integration_helper' | |
require 'rack' | |
require 'rack/handler/webrick' | |
describe HttpClient do | |
before :all do | |
@server = WEBrick::HTTPServer.new( | |
:Port => 9293, | |
:Logger => Rails.logger, | |
:AccessLog => Rails.logger |