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 […]

Rails 4, phantom ArgumentError: wrong number of arguments (0 for 1) on UserSession.find for AuthLogic

This was a total pain to locate, as the exceptions being raised were pointed to UserSession.find in Authlogic::Session::Persistence. gems in question: activerecord-session_store 0.1.1 authlogic 3.4.6 activerecord 4.2.3 rails 4.2.3 I noticed that the only meaningful difference between the two environments was the following instance variable in Rails.application.config: irb> pp Rails.application.config . . . @logger= # […]

Pundit: NoMethodError (undefined method `verify_authorized’ for [WhateversController])

Sometimes, having done things several times before can make you miss the OBVIOUS. After adding after_action :verify_authorized to my ApplicationController to verify that Pundit was being used for authorization, I got the following error in rspec: 2) Jobs GET /jobs works! (now write some real specs) Failure/Error: get jobs_path NoMethodError: undefined method `verify_authorized’ for # […]

devise_security_extension undefined method authenticate for nil:NilClass on Rspec Tests for Controller That Skips Authentication

After installing the Devise Security Extension to add password expiration to my Devise models, I started getting the following error on an RSpec test for a controller that does not perform authentication of the user: Failure/Error: get :index NoMethodError: undefined method `authenticate?’ for nil:NilClass After a bit of digging, I found that the helpers.rb in […]

Rails AntiPatterns Review/Summary

I’ve had the Rails AntiPatterns: Best Practice Ruby on Rails Refactoring (Addison-Wesley Professional Ruby Series) book on my Safari Books Online bookshelf for almost a year now, and finally started reading through it. It was “updated for Rails 3”, and there doesn’t appear to be a newer version, so I was a bit skeptical about […]

Filter chain halted as :find_page rendered or redirected in refinerycms

I ended up coming across this issue in Refinery CMS after switching databases. I had forgotten that I had swapped out databases because I had moved on to changing some other configuration bits in following the RailsCast for Refinery CMS. Fortunately, I found note on Refinery’s Getting Started page that deals with this: If you […]