From a6e07a0bbd48399f0515005296517acad1fbd98e Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Sat, 14 Sep 2024 19:15:13 -0700 Subject: [PATCH] split end to end tests in profile to separate describe block --- spec/system/profile_spec.rb | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/spec/system/profile_spec.rb b/spec/system/profile_spec.rb index 123f68c7e43971..85a59a71be0249 100644 --- a/spec/system/profile_spec.rb +++ b/spec/system/profile_spec.rb @@ -31,13 +31,20 @@ expect(subject).to have_content 'Changes successfully saved!' end - it 'Can have custom account_css set', :js do - visit account_path('alice') - expect(subject.html).to have_content('background-color: red !important') - expect(subject).to have_xpath('//*[@id="account-css"]') - - visit account_path('bob') - expect(subject.html).to have_no_content('background-color: red !important') - expect(subject).to have_no_xpath('//*[@id="account-css"]') + describe 'with JS', :js do + before do + as_a_logged_in_user + with_alice_as_local_user + end + + it 'Can have custom account_css set' do + visit account_path('alice') + expect(subject.html).to have_content('background-color: red !important') + expect(subject).to have_xpath('//*[@id="account-css"]') + + visit account_path('bob') + expect(subject.html).to have_no_content('background-color: red !important') + expect(subject).to have_no_xpath('//*[@id="account-css"]') + end end end