Sha256: a788f4e9bdac4e11c107c6c5b088a92206f86bd280b0e6973e93208d78dcefd1
Contents?: true
Size: 1.03 KB
Versions: 43
Compression:
Stored size: 1.03 KB
Contents
require 'action_controller/integration' class Facebooker::Rails::IntegrationSession < ActionController::Integration::Session include Facebooker::Rails::TestHelpers attr_accessor :default_request_params, :canvas def process(method, path, parameters = nil, headers = nil) if canvas parameters = facebook_params(@default_request_params.merge(parameters || {})) end super method, path, parameters, headers end def reset! self.default_request_params = {:fb_sig_in_canvas => '1'}.with_indifferent_access self.canvas = true super end def get(path, parameters = nil, headers = nil) if canvas post path, (parameters || {}).merge('fb_sig_request_method' => 'GET'), headers else super path, parameters, headers end end %w(put delete).each do |method| define_method method do |*args| if canvas path, parameters, headers = *args post path, (parameters || {}).merge('_method' => method.upcase), headers else super *args end end end end
Version data entries
43 entries across 43 versions & 9 rubygems