Thursday 19 January 2017

RSpec failing after a new Rails Composer project



RSpec issues

Add
require 'rails_helper.rb'
into the spec files to allow the tests to run as expected.

spec/features/visitors/sign_up_spec.rb

The minimum password length is set to be 6 characters, but the 'expected fail' password was set to 'please', causing the test to fail.

Changed password to 'short' and test passes.

spec/features/users/sign_in_spec.rb

The tests were looking for an authentication_key of 'email'. Changed to 'Email' to match the results from Devise.

Tuesday 10 January 2017

Getting Puma to listen for all hosts with the Guardfile

This has been bugging me for a while, and I've finally had time to track down how to configure Guardfile in order to have Puma listen to all ip addresses.

guard 'rails', :host => '0.0.0.0' do
  watch('Gemfile.lock')
  watch(%r{^(config|lib)/.*})
end

Adding the :host => '0.0.0.0' gets puma to listen for all addresses.