4: def make_request(method, path, params={}, referring_uri=nil, use_xhr=false)
5: if self.kind_of?(ActionController::IntegrationTest)
6: if use_xhr
7: params = {'_method' => method }.merge(params)
8: xml_http_request :post, path, params
9: else
10: self.send(method, path, params.stringify_keys, {:referer => referring_uri})
11: end
12: else
13: params.merge!(ActionController::Routing::Routes.recognize_path(path, :method => method))
14:
15:
16:
17: self.instance_eval("@request").env["HTTP_REFERER"] ||= referring_uri
18: if use_xhr
19: self.xhr(method, params.delete(:action), params.stringify_keys)
20: else
21: self.send(method, params.delete(:action), params.stringify_keys)
22: end
23: end
24: end