Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module XhrHelpers
- def xhr(path, params = {})
- verb = params.delete(:as) || :get
- send(verb,path, params, "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest")
- end
- alias_method :ajax, :xhr
- end
- RSpec.configuration.include XhrHelpers, :type => :controller
Add Comment
Please, Sign In to add comment