From 323748b9cc6760b86f95780aecb3485c12d0a29a Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Sat, 14 Sep 2024 19:32:03 -0700 Subject: [PATCH] restore fancy profile to non-alice profile where it belongs --- spec/support/stories/profile_stories.rb | 19 ++++++++++++++----- spec/system/profile_spec.rb | 5 ++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/spec/support/stories/profile_stories.rb b/spec/support/stories/profile_stories.rb index c85e5e7da0eb69..cad06a17e57426 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, :alice_css + attr_reader :bob, :alice, :alice_bio, :chupacabra, :chupacabra_css def fill_in_auth_details(email, password) fill_in 'user_email', with: email @@ -35,16 +35,25 @@ 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_css = <<~CSS + + @alice = Fabricate( + :user, + email: 'alice@example.com', password: password, confirmed_at: confirmed_at, + account: Fabricate(:account, username: 'alice', note: @alice_bio) + ) + end + + def with_chupacabras_fancy_profile + @chupacabra_css = <<~CSS body { background-color: red !important; } CSS - @alice = Fabricate( + @chupacabra = Fabricate( :user, - email: 'alice@example.com', password: password, confirmed_at: confirmed_at, - account: Fabricate(:account, username: 'alice', note: @alice_bio, account_css: @alice_css) + email: 'chupacabra@example.com', password: password, confirmed_at: confirmed_at, + account: Fabricate(:account, username: 'chupacabra', note: 'I am gonna getcha!', account_css: @chupacabra_css) ) end diff --git a/spec/system/profile_spec.rb b/spec/system/profile_spec.rb index 85a59a71be0249..b7763f219101a8 100644 --- a/spec/system/profile_spec.rb +++ b/spec/system/profile_spec.rb @@ -33,12 +33,11 @@ describe 'with JS', :js do before do - as_a_logged_in_user - with_alice_as_local_user + with_chupacabras_fancy_profile end it 'Can have custom account_css set' do - visit account_path('alice') + visit account_path('chupacabra') expect(subject.html).to have_content('background-color: red !important') expect(subject).to have_xpath('//*[@id="account-css"]')