From e2d114f00b3c38a31c3bc8482ca6645f256e3938 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 25 Jul 2025 11:58:12 -0400 Subject: [PATCH] Share common factory setup --- spec/helpers/admin/dashboard_helper_spec.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/spec/helpers/admin/dashboard_helper_spec.rb b/spec/helpers/admin/dashboard_helper_spec.rb index 9c674fb4b96..db95eb9f2ce 100644 --- a/spec/helpers/admin/dashboard_helper_spec.rb +++ b/spec/helpers/admin/dashboard_helper_spec.rb @@ -4,8 +4,9 @@ require 'rails_helper' RSpec.describe Admin::DashboardHelper do describe 'relevant_account_timestamp' do + let(:account) { Fabricate(:account) } + context 'with an account with older sign in' do - let(:account) { Fabricate(:account) } let(:stamp) { 10.days.ago } it 'returns a time element' do @@ -18,8 +19,6 @@ RSpec.describe Admin::DashboardHelper do end context 'with an account with newer sign in' do - let(:account) { Fabricate(:account) } - it 'returns a time element' do account.user.update(current_sign_in_at: 10.hours.ago) result = helper.relevant_account_timestamp(account) @@ -29,8 +28,6 @@ RSpec.describe Admin::DashboardHelper do end context 'with an account where the user is pending' do - let(:account) { Fabricate(:account) } - it 'returns a time element' do account.user.update(current_sign_in_at: nil) account.user.update(approved: false) @@ -42,7 +39,6 @@ RSpec.describe Admin::DashboardHelper do end context 'with an account with a last status value' do - let(:account) { Fabricate(:account) } let(:stamp) { 5.minutes.ago } it 'returns a time element' do @@ -56,8 +52,6 @@ RSpec.describe Admin::DashboardHelper do end context 'with an account without sign in or last status or pending' do - let(:account) { Fabricate(:account) } - it 'returns a time element' do account.user.update(current_sign_in_at: nil) result = helper.relevant_account_timestamp(account)