Guest User

Untitled

a guest
Jul 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. module XhrHelpers
  2.  
  3. def xhr(path, params = {})
  4. verb = params.delete(:as) || :get
  5. send(verb,path, params, "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest")
  6. end
  7. alias_method :ajax, :xhr
  8. end
  9.  
  10. RSpec.configuration.include XhrHelpers, :type => :controller
Add Comment
Please, Sign In to add comment