tjgrathwell/rails5-spec-converter

:headers / :xhr should not be wrapped in :params

Opened this issue · 1 comments

Thanks a lot for this project! You've saved me (and probably many others) countless hours of brainless rewriting of tests.

But, I have one issue currently: We have quite a lot of tests in our test suite, where we only set the :headers but not the :params:

get users_path, headers: { my_header: 'gugus' }

The tool currently does not correctly recognize that the :headers part should not be wrapped within :params, because the resulting code is:

get users_path, params: { headers: { my_header: 'gugus' } }

I'm probably going to open a PR later for fixing this problem.

I just noticed that the :xhr attribute has the same problem and is also wrapped within :params. I'm quickly going to change that in my PR too.