-
Hooking in an LDAP Test Server to Cucumber Tests
I managed to get a custom Devise strategy with LDAP working, but had no clear way of automating tests. I wanted to validate if I still had to keep the password fresh in the database, and needed to be able to write scenarios around that in case someone attempted to refactor out the code. After…
-
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…
-
Ruby Keyword Argument Implementation Differences Between 2.1 and 2.2
I’m currently reading through Ruby Under a Microscope: An Illustrated Guide to Ruby Internals, and when I tried to test the “hidden hash” in ruby 2.2, I got different results from the book. In Ruby 2.2, it appears that the default arguments are used as one expects, without regard to the Hash monkey patch: ###…