Module: Mack::Testing::Helpers
- Defined in:
- lib/mack-javascript/helpers/testing_helpers.rb
Instance Method Summary collapse
-
#xhr(method, uri, options = {}) ⇒ Object
simulates an ajax request.
Instance Method Details
#xhr(method, uri, options = {}) ⇒ Object
simulates an ajax request
5 6 7 8 |
# File 'lib/mack-javascript/helpers/testing_helpers.rb', line 5 def xhr(method, uri, = {}) = {:input => .to_params} if method == :post || method == :put build_response(request.send(method, uri, (.merge({"HTTP_X_REQUESTED_WITH" => 'XMLHttpRequest', "HTTP_ACCEPT" => 'text/javascript, text/html, application/xml, text/xml, */*'})))) end |