From 30f2e202092a626a4b8b553d62dee6201f3683de Mon Sep 17 00:00:00 2001 From: Aidan Cornelius-Bell Date: Wed, 1 Jan 2025 08:13:37 +1030 Subject: [PATCH] Include devise in tests --- test/fixtures/users.yml | 6 +++--- test/test_helper.rb | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index d2d415b..e825008 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -9,7 +9,7 @@ admin: first_name: Admin last_name: User admin: true - encrypted_password: <%= BCrypt::Password.create('password123') %> + encrypted_password: <%= Devise::Encryptor.digest(User, 'password123') %> confirmed_at: <%= Time.current - 1.month %> support_type: ongoing subscription_status: active @@ -20,7 +20,7 @@ regular_user: first_name: Regular last_name: User admin: false - encrypted_password: <%= BCrypt::Password.create('password123') %> + encrypted_password: <%= Devise::Encryptor.digest(User, 'password123') %> confirmed_at: <%= Time.current - 2.weeks %> support_type: non_financial subscription_status: @@ -31,7 +31,7 @@ paid_user: first_name: Paid last_name: User admin: false - encrypted_password: <%= BCrypt::Password.create('password123') %> + encrypted_password: <%= Devise::Encryptor.digest(User, 'password123') %> confirmed_at: <%= Time.current - 1.week %> support_type: one_time subscription_status: one_time diff --git a/test/test_helper.rb b/test/test_helper.rb index 0c22470..57e7715 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,7 @@ ENV["RAILS_ENV"] ||= "test" require_relative "../config/environment" require "rails/test_help" +require 'devise' # Add this line module ActiveSupport class TestCase -- 2.39.5