From 215cfb7990b6bfc7231a8beaef1e91f21ceb3210 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Thu, 30 Apr 2020 16:20:31 +0200 Subject: [PATCH] Follow up - 9402699a4209a67bf949a2c72f4344e8585bf7dd - DX: Developer should not need to add a password for each created user that should login. Therefore create one if non is set yet. --- spec/support/capybara/authenticated.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/support/capybara/authenticated.rb b/spec/support/capybara/authenticated.rb index 0b036d96e..d2abb078f 100644 --- a/spec/support/capybara/authenticated.rb +++ b/spec/support/capybara/authenticated.rb @@ -21,7 +21,10 @@ RSpec.configure do |config| user = instance_exec(&authenticated) password = user.password_plain - raise "Can't authenticate user that has no password set" if password.blank? + if password.blank? + password = 'automagically set by your friendly capybara helper' + user.update!(password: password) + end credentials = { username: user.email,