-
XML Handler Bypassing ParseError Handling Rack Middleware on Rails 6
In a project using actionpack-xml_parser, and implementing a modified version of Catching Invalid JSON Parse Errors with Rack Middleware to also handle XML errors, an upgrade to Rails 6 broke the handling of the ParseError. Interestingly enough, JSON was being handled as expected. TL;DR: The short answer to this is that config/initializers/wrap_parameters.rb only had json…
-
rspec-rails tricks: Hacking Your Routes for a Spec
I don’t know that this is so much a reminder of “What can be done with rspec-rails” as a note that, “If you do this will rspec-rails, you will also need to undo it.” Today’s note: If you hack the application routes for a controller test, you have to reload routes. The original problem This…
-
RailsSettings vs parallel_tests
RailsSetting stubbing problem I have an area of functionality that is controlled by a Settings class that is a subclass of RailsSettings::CachedSettings (rails-settings-cached gem) and changing that setting for tests was interfering with the parallel_tests gem when I ran my rspec tests. I tried namespacing the cache, making TTL 0, invalidating the cache, monkeypatching the…