4: def make_request(method, path, params={}, referring_uri=nil, use_xhr=false)
5: if self.kind_of?(ActionController::IntegrationTest)
6: self.send(method, path, params.stringify_keys, {:referer => referring_uri})
7: else
8: params.merge!(ActionController::Routing::Routes.recognize_path(path, :method => method))
9: if params[:controller] && params[:controller] != current_controller = self.instance_eval("@controller").controller_path
10: raise "Can't follow links outside of current controller (from #{current_controller} to #{params[:controller]})"
11: end
12: self.instance_eval("@request").env["HTTP_REFERER"] ||= referring_uri
13: if use_xhr
14: self.xhr(method, params.delete(:action), params.stringify_keys)
15: else
16: self.send(method, params.delete(:action), params.stringify_keys)
17: end
18: end
19: end