nebulab / cangaroo

Connect Any App to Any Service
https://github.com/nebulab/cangaroo
MIT License
107 stars 18 forks source link

Fix tests failing on master due to Rails 4 compatibility issues #60

Closed davidlaprade closed 6 years ago

davidlaprade commented 6 years ago

51 cleaned up portions of the test suite to remove deprecation warnings generated by Rails5. Unfortunately, it made the test suite incompatible with Rails 4. That's because the post method used in the rspec tests is actually a part of Rails. And between Rails 4.2. and Rails 5.1. the arity of that method changed. The #post of 4.2. expected multiple positional arguments, i.e.

post path, params, headers

whereas the #post of 5.1 expects a hash, i.e.

post path, params: params, headers: headers

Using the new, non-positional arguments in the tests fixed the deprecation warnings for Rails 5 at the cost of breaking our Rails 4 tests. Since Rails 5 is still consistent with the old argument pattern (but Rails 4 is not consistent with the new pattern), I suggest that we revert for now. If/when they stop supporting the old arguments in Rails 5 we can decide whether its worth it to maintain backwards compatibility with Rails 4.

bricesanchez commented 6 years ago

Thanks @davidlaprade !