Skip to content

Commit

Permalink
split end to end tests in profile to separate describe block
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Sep 15, 2024
1 parent 1114eee commit a6e07a0
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions spec/system/profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a6e07a0

Please sign in to comment.