tjgrathwell / rails5-spec-converter

A tool to upgrade Rails 4-style specs to Rails 5-style
MIT License
176 stars 14 forks source link

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

Open vongruenigen opened 5 years ago

vongruenigen commented 5 years ago

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.

vongruenigen commented 5 years ago

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.