Skip to main content
added 108 characters in body
Source Link
Mohanraj
  • 4.2k
  • 2
  • 25
  • 25

You can passIf you really need this kind of scenario, you have to use the query string with postRails URI pattern instead of only specifying action name in the post statement like below,

post :post'/documents/create_new_doc', params: {same_key: 'value_in_body'} # params: is required for Rails 4.2 and after 

Note: Get the exact URI pattern from rake routes

You can pass the query string with post statement like below,

post :post, params: {same_key: 'value_in_body'} # params: is required for Rails 4.2 and after 

If you really need this kind of scenario, you have to use the Rails URI pattern instead of only specifying action name in the post statement,

post '/documents/create_new_doc', params: {same_key: 'value_in_body'} 

Note: Get the exact URI pattern from rake routes

Source Link
Mohanraj
  • 4.2k
  • 2
  • 25
  • 25

You can pass the query string with post statement like below,

post :post, params: {same_key: 'value_in_body'} # params: is required for Rails 4.2 and after