<div dir="ltr">I've just upgraded our Rails app from 3.2.something to 4.1.1<div><br></div><div>Having thought the test coverage was pretty good, a couple of bugs were found which were not picked up by Rspec post-upgrade.</div>
<div><br></div><div>The authlogic gem is used for logging in, and its encryption mechanism changed, meaning effectively no one could log in. Details here: <a href="https://github.com/binarylogic/authlogic/issues/400">https://github.com/binarylogic/authlogic/issues/400</a></div>
<div><br></div><div>I'm struggling to conceive a test which would capture this, short of setting the crypted_password field for a user directly in the database, which seems like very tight coupling.</div><div><br></div>
<div>Secondly, a POST stopped working and needed to be replaced with PATCH, mentioned here: <a href="http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#http-patch">http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#http-patch</a></div>
<div><br></div><div>Essentially my controller tests can call 'post' or 'get' or 'patch' on a method, and the named controller method will get invoked in the test.</div><div>However in the real world, only an HTTP PATCH will work (or a POST with 'patch' set for the _method parameter).</div>
<div>What test should pick this up? Do I need router tests for every controller test?</div><div><br></div><div>Thanks</div></div>