Saturday, 4 November 2017

[Solved] Deprecation warnings Devise::TestHelpers

Another entry in the series of 'notes to myself' here.
A simple fix for the Deprecation warning saying that Devise::TestHelpers will be removed.
The fix is to replace the
 config.include Devise::Test::Helpers, :type => :controller  
with
config.include Devise::Test::ControllerHelpers, :type => :controller  
in spec/rails_helper.rb.
Unlike many of the suggested solutions, I don't have the devise configuration in the rails_helper file.
I have a separate set of helper functions, and the relevant location is 
spec/support/devise.rb.
 RSpec.configure do |config|  
  config.include Devise::Test::ControllerHelpers, :type => :controller  
 end  



You can stop reading now and go do something more productive instead.

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.

Wednesday, 7 December 2016

Lost Dreams

Why do words come when I'm sad?
Nothing flows right when I'm glad.

I've told you how I feel, so why
You tell me things, nearly make me cry.

Hearing tales of lovers found
Im not the liked one, I'm losing ground

Games of strip poker, you were losing
Never seeing what I've been musing

You're not the first to break this ground
I now wonder why I'm not underground

Dreams of hope, sunk in the bog.
Sniffing my ankles, that great black Dog

Each night I hope as I wait for sleep
Sadly morning comes round but I'm still around

Saturday, 22 October 2016

Rails woes on Windows 10

The Rails community isn't strong on support for Windows based machines.

The github repository RubyOnWindowsWoes contains the source and issues found.

This note is to remind me how I eventually solve the problems!

Thursday, 13 October 2016

ConfigurationManager does not exist in the current context

This was plaguing me for some time.

Part of the solution is the
#include System.Config

The bit I kept missing was to include the System.Configuration reference to the project.

Sigh.


Monday, 28 December 2015

Windows 10 flickering on top few pixels after update

A bit of history first.

My laptop was originally a Windows 8.1 machine, and was updated to Windows 10 when that became available (although it took two attempts).

It has just had the November update applied (which took a long, long time).

Post update, I have noticed a flickering across the top few pixels of the screen. A quick look at recent posts didn't give many useful hints.

I had a look at the advanced screen settings, and saw the screen was set to 1366 x 768 picels - this wasn't the resolution I was expecting. I dropped the resolution to 1360 x 768 and this seems to have stopped the issue.

The recommended resolution is 1366 though, and I don't understand why changing the horizontal resolution has stopped the issue.