Remove single-use ProfileStories method (#31164)

This commit is contained in:
Matt Jankowski 2024-10-23 09:31:03 -04:00 committed by GitHub
parent a850be4ad3
commit 5a4f4f3e83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 15 deletions

View File

@ -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
@ -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

View File

@ -11,10 +11,10 @@ RSpec.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})")