Skip to content

Instantly share code, notes, and snippets.

@andreacfm
Last active January 13, 2018 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreacfm/5057815 to your computer and use it in GitHub Desktop.
Save andreacfm/5057815 to your computer and use it in GitHub Desktop.
Blog code
get :show, id: 1 # normal request
xhr :get, :show, id: 1 # exactly the same request, This time fake to be an xhr call. request.xhr? will be true
@slim1979
Copy link

Hi there. When i try to add hxr to test, i got an error:

NoMethodError:
       super: no superclass method `xhr' for #<RSpec::ExampleGroups::QuestionsController::GETIndex:0x0000000302d728>

Don't you know, how can i fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment