From 1b23091ac7b80ed282d050cb66d4a3e9b8203921 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 26 Jul 2024 11:28:12 -0400 Subject: [PATCH 1/2] Remove single-use `ProfileStories` method --- spec/support/stories/profile_stories.rb | 12 ------------ spec/system/profile_spec.rb | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/spec/support/stories/profile_stories.rb b/spec/support/stories/profile_stories.rb index 07eaaca9fb9..35e84ea16ef 100644 --- a/spec/support/stories/profile_stories.rb +++ b/spec/support/stories/profile_stories.rb @@ -31,18 +31,6 @@ module ProfileStories bob.update!(role: UserRole.find_by!(name: 'Admin')) end - def with_alice_as_local_user - @alice_bio = '@alice and @bob are fictional characters commonly used as' \ - 'placeholder names in #cryptology, as well as #science and' \ - 'engineering 📖 literature. Not affiliated with @pepe.' - - @alice = Fabricate( - :user, - email: 'alice@example.com', password: password, confirmed_at: confirmed_at, - account: Fabricate(:account, username: 'alice', note: @alice_bio) - ) - end - def confirmed_at @confirmed_at ||= Time.zone.now end diff --git a/spec/system/profile_spec.rb b/spec/system/profile_spec.rb index 2517e823b50..68ffb8e74d5 100644 --- a/spec/system/profile_spec.rb +++ b/spec/system/profile_spec.rb @@ -11,10 +11,10 @@ describe 'Profile' do before do as_a_logged_in_user - with_alice_as_local_user + Fabricate(:user, account: Fabricate(:account, username: 'alice')) end - it 'I can view Annes public account' do + it 'I can view public account page for Alice' do visit account_path('alice') expect(subject).to have_title("alice (@alice@#{local_domain})") From 59f05d1904bfebfa79ea906a08fde984fee9d4b6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 29 Jul 2024 09:46:21 -0400 Subject: [PATCH 2/2] Remove attr reader dec --- spec/support/stories/profile_stories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/stories/profile_stories.rb b/spec/support/stories/profile_stories.rb index 35e84ea16ef..43a8e170ccb 100644 --- a/spec/support/stories/profile_stories.rb +++ b/spec/support/stories/profile_stories.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module ProfileStories - attr_reader :bob, :alice, :alice_bio + attr_reader :bob def fill_in_auth_details(email, password) fill_in 'user_email', with: email