From 268a370f4d65fe136c97f1a9f8cdeb1e4140447d Mon Sep 17 00:00:00 2001 From: Vivian Ha Date: Wed, 13 Nov 2024 11:18:30 -0500 Subject: [PATCH] Switch order of accessibility tests --- spec/features/accessibility_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/features/accessibility_spec.rb b/spec/features/accessibility_spec.rb index a7fb238..a25f405 100644 --- a/spec/features/accessibility_spec.rb +++ b/spec/features/accessibility_spec.rb @@ -23,28 +23,28 @@ end end - context 'when editing new locker application' do + context 'when visiting the sign in page' do before do - sign_in admin - end - - let(:locker_application) do - FactoryBot.create(:locker_application, complete: true, accessibility_needs: ['Keyed entry (rather than combination)', 'Another need']) + visit '/sign_in' end it 'complies with wcag' do - visit edit_locker_application_path(id: locker_application.id) expect(page).to be_axe_clean .according_to(:wcag2a, :wcag2aa, :wcag21a, :wcag21aa) end end - context 'when visiting the sign in page' do + context 'when editing new locker application' do before do - visit '/sign_in' + sign_in admin + end + + let(:locker_application) do + FactoryBot.create(:locker_application, complete: true, accessibility_needs: ['Keyed entry (rather than combination)', 'Another need']) end it 'complies with wcag' do + visit edit_locker_application_path(id: locker_application.id) expect(page).to be_axe_clean .according_to(:wcag2a, :wcag2aa, :wcag21a, :wcag21aa) end