Skip to content

Commit

Permalink
Update be_accessible syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
camillevilla committed Mar 12, 2024
1 parent e4ed293 commit c6c8b79
Show file tree
Hide file tree
Showing 29 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion spec/features/about_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

describe 'Intro section' do
it '\'Diffusion of Excellence\' link should take the user to the Diffusion of Excellence page at va.gov' do
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508

new_window = window_opened_by { click_link('Diffusion of Excellence') }
within_window new_window do
Expand Down
8 changes: 4 additions & 4 deletions spec/features/admin/admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def visit_practice_show
it 'if not logged in, should be redirected to sign_in page' do
visit '/admin'

expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_current_path(new_user_session_path)
end

it 'if logged in as a non-admin, should be redirected to landing page' do
login_as(@user, scope: :user, run_callbacks: false)
visit '/admin'

expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_current_path(root_path)
expect(page).to have_content('Unauthorized access!')
end
Expand All @@ -75,7 +75,7 @@ def visit_practice_show
login_as(@admin, scope: :user, run_callbacks: false)
visit '/admin'

expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_current_path(admin_root_path)

expect(page).to have_link('General', href: '#general')
Expand All @@ -101,7 +101,7 @@ def visit_practice_show
login_as(@admin, scope: :user, run_callbacks: false)
visit '/admin'

expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_current_path(admin_root_path)

within(:css, '#header') do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/homepage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

describe 'search section' do
it 'should allow the user to search for practices in a number of ways' do
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508

# search for a practice using the search field
fill_in('dm-homepage-search-field', with: 'James A. Haley')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
context 'Render' do
it 'renders form' do
visit '/nominate-an-innovation'
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('Nominate an innovation')
expect(page).to have_content('VA staff and collaborators are welcome to nominate active innovations for consideration on the Diffusion Marketplace using the form below.')
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/pages/show_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@

visit '/programming/javascript'
# Make sure the map components are 508 compliant
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_css('.page-map-component', count: 2)
within(all('.page-map-component').first) do
expect_marker_ct(1)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/practice_editor/about_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
end

it 'should be there' do
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('About')
expect(page).to have_content('This section helps people understand how your innovation started and introduces the original team.')
end
Expand Down
4 changes: 2 additions & 2 deletions spec/features/practice_editor/adoptions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
)
login_as(@admin, :scope => :user, :run_callbacks => false)
visit practice_adoptions_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

after do
Expand Down Expand Up @@ -128,7 +128,7 @@ def submit_form
expect(page).to have_content('Success!')
expect(page).to have_content('In-progress adoption: 1')
end
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508

# it should create another one
find('#add_adoption_button').click
Expand Down
8 changes: 4 additions & 4 deletions spec/features/practice_editor/authorization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
it 'should allow admin level users to edit a practice' do
login_as(@admin, :scope => :user, :run_callbacks => false)
visit practice_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@practice.name)
end

it 'should let an editor user edit a practice' do
login_as(@approver, :scope => :user, :run_callbacks => false)
@user_practice.update(approved: true, published: true)
visit practice_path(@user_practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_link(href: "/innovations/#{@user_practice.slug}/edit/editors")
end

Expand All @@ -35,15 +35,15 @@

login_as(@user_2, :scope => :user, :run_callbacks => false)
visit practice_introduction_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('Introduction')
expect(page).to have_content('Introduce your innovation and provide a brief summary to people who may be unfamiliar with it.')
end

it 'should not allow the following user types to edit a practice: non-admins, non-practice owners, and non-practice editors' do
login_as(@user, :scope => :user, :run_callbacks => false)
visit practice_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@practice.name)
expect(page).to_not have_link(href: "/innovations/#{@practice.slug}/edit/instructions")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/practice_editor/editors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def login_and_visit_editors(user)

it 'should be there' do
login_and_visit_editors(@admin)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('Editors')
expect(page).to have_content('E-mail the people who can help you edit this innovation page. Only @va.gov emails are allowed.')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
add_another_btns.each do |btn|
btn.click
end
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end
end
end
4 changes: 2 additions & 2 deletions spec/features/practice_editor/implementation/timeline_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
login_as(@admin, :scope => :user, :run_callbacks => false)
visit practice_implementation_path(@practice)
page.driver.browser.manage.window.resize_to(1200, 600) # need to set this otherwise mobile version of editor displays
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
@time_frame = '3 Months'
@milestone = 'Test milestone'
@add_timeline_step_button = find('#link_to_add_button_timeline')
end

it 'should be there' do
@save_button = find('#practice-editor-save-button')
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('Timeline')
expect(page).to have_content('Add timeline step')
fill_in_core_people_field
Expand Down
2 changes: 1 addition & 1 deletion spec/features/practice_editor/instructions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
before do
login_as(@admin, :scope => :user, :run_callbacks => false)
visit practice_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

it 'displays as a modal' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
before do
login_as(@admin, :scope => :user, :run_callbacks => false)
visit_practice_edit
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

it 'should display the content correctly' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/practice_editor/metrics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

describe 'Authorization' do
before do
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

it 'Should allow authenticated users to view metrics' do
Expand Down
4 changes: 2 additions & 2 deletions spec/features/practice_editor/overview/overview_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
describe 'view and editor' do
it 'should be accessible' do
visit practice_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
visit practice_overview_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

it 'should be able to change the problem, solution, results, statements' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/practice_editor/publish_practice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
before do
login_as(@admin, :scope => :user, :run_callbacks => false)
visit practice_introduction_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
@save_button = find('#practice-editor-save-button')
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/practice_editor/step_indicator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
before do
login_as(@admin, :scope => :user, :run_callbacks => false)
visit practice_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

it 'should display the step indicator on each page' do
Expand Down
4 changes: 2 additions & 2 deletions spec/features/practice_partners_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
it 'should navigate to strategic sponsors list page' do
visit '/partners'
# TODO: this is timing out in CI
# expect(page).to be_accessible.according_to :wcag2a, :section508
# expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(current_path).to eq('/partners')
end

Expand All @@ -60,7 +60,7 @@
it 'should show the initiating facility\'s name' do
@pr_1.update(initiating_facility: 'Foobar Facility')
visit '/partners/diffusion-of-excellence'
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@pr_1.name)
expect(page).to have_content('Foobar Facility')
end
Expand Down
24 changes: 12 additions & 12 deletions spec/features/practice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
it 'should let unauthenticated users interact with public-facing practices' do
# Visit an unpublished, unapproved, internal-facing practice
visit '/innovations/the-best-practice-ever'
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('You are not authorized to view this content.')

@user_practice.update(approved: true, published: true, is_public: true)
# Visit a published, approved, public-facing practice
visit '/innovations/the-best-practice-ever'
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('The Best Practice Ever!')
expect(page).to have_content('Test Facility')
end
Expand All @@ -63,13 +63,13 @@

# Visit an individual practice that is approved and published
visit practice_path(@practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@practice.name)
expect(page).to have_current_path(practice_path(@practice))

# Visit the Marketplace
visit '/'
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('We’re a discovery and collaboration tool that curates VA’s promising innovations, encourages their diffusion, and fosters engagement with greater healthcare communities.')
expect(page).to have_link(href: '/about')
expect(page).to have_content('Browse all innovations')
Expand All @@ -86,7 +86,7 @@

# Visit user's own practice that is not approved or published
visit practice_path(@user_practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_current_path(practice_path(@user_practice))
expect(page).to have_content(@user_practice.name)
end
Expand All @@ -95,7 +95,7 @@
login_as(@user2, :scope => :user, :run_callbacks => false)
# Visit a user's practice that is not approved or published
visit practice_path(@user_practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content('We’re a discovery and collaboration tool that curates VA’s promising innovations, encourages their diffusion, and fosters engagement with greater healthcare communities.')
expect(page).to have_current_path('/')
end
Expand All @@ -105,7 +105,7 @@

# Visit a user's practice that is not approved or published
visit practice_path(@user_practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@user_practice.name)
expect(page).to have_current_path(practice_path(@user_practice))
end
Expand All @@ -115,7 +115,7 @@

# Visit a user's practice that is not approved or published
visit practice_path(@user_practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@user_practice.name)
expect(page).to have_current_path(practice_path(@user_practice))
end
Expand All @@ -139,7 +139,7 @@
practice = Practice.create!(name: 'Another public practice', date_initiated: Time.now(), approved: true, published: true, initiating_facility_type: 'facility', tagline: 'Test tagline', user: @user2)
PracticeOriginFacility.create!(practice: practice, facility_type: 0, va_facility: @facility_1)
visit practice_path(practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(practice.name)
expect(page).to have_content('Yakima VA Clinic')
expect(page).to have_current_path(practice_path(practice))
Expand All @@ -151,7 +151,7 @@
login_as(@admin, :scope => :user, :run_callbacks => false)
# Visit an individual Practice that is enabled
visit practice_path(@enabled_practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@enabled_practice.name)
expect(page).to have_content(@enabled_practice.initiating_facility)
expect(page).to have_current_path(practice_path(@enabled_practice))
Expand All @@ -173,7 +173,7 @@
@user_practice.update(published: true, approved: true, initiating_facility: 'Page VA Clinic')
# Visit an individual Practice that is approved and published
visit practice_path(@user_practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@user_practice.name)
expect(page).to have_content(@user_practice.initiating_facility)
expect(page).to have_current_path(practice_path(@user_practice))
Expand All @@ -184,7 +184,7 @@
@user_practice.update(published: true, approved: true, difficulty_aggregate: 1, sustainability_aggregate: 2, number_departments: 3, it_required: true, process: 'New approach', implementation_time_estimate: '6 months', training_provider: 'Practice champion', training_test: true, need_new_license: true, training_length: '1 month')
visit practice_path(@user_practice)

expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(@user_practice.name)
expect(page).to have_content(@user_practice.initiating_facility)
expect(page).to have_current_path(practice_path(@user_practice))
Expand Down
6 changes: 3 additions & 3 deletions spec/features/practice_viewer/contact_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Login as an authenticated user and visit the practice page
login_as(user1, :scope => :user, :run_callbacks => false)
visit practice_path(practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(practice.name)
expect(page).to have_current_path(practice_path(practice))
expect(page).to have_css('.commontator')
Expand All @@ -25,7 +25,7 @@
login_as(user2, :scope => :user, :run_callbacks => false)
page.set_rack_session(:user_type => 'ntlm')
visit practice_path(practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(practice.name)
expect(page).to have_content("Other")
expect(page).to have_content('I am currently adopting this innovation')
Expand All @@ -36,7 +36,7 @@
# make the practice public, so the user is not redirected
practice.update(is_public: true)
visit practice_path(practice)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
expect(page).to have_content(practice.name)
expect(page).to have_current_path(practice_path(practice))
expect(page).to have_content('Comments and replies are disabled for retired innovations and non-VA users.')
Expand Down
4 changes: 2 additions & 2 deletions spec/features/practice_viewer/introduction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
describe 'action buttons' do
before do
visit practice_path(@pr_min)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

it 'should exist' do
Expand All @@ -118,7 +118,7 @@
describe 'see more buttons' do
before do
visit practice_path(@pr_max)
expect(page).to be_accessible.according_to :wcag2a, :section508
expect(page).to be_axe_clean.according_to :wcag2a, :section508
end

it 'should exist' do
Expand Down
Loading

0 comments on commit c6c8b79

Please sign in to comment.