Skip to content

Restructure PIV/CAC setup spec for consistency#11355

Merged
aduth merged 1 commit intomainfrom
aduth-restructure-piv-setup-spec
Oct 17, 2024
Merged

Restructure PIV/CAC setup spec for consistency#11355
aduth merged 1 commit intomainfrom
aduth-restructure-piv-setup-spec

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Oct 16, 2024

🎫 Ticket

Refactoring related to LG-14455

🛠 Summary of changes

Updates specs for Users::PivCacAuthenticationSetupController to fix inaccuracies and follow conventions:

  • Specs described #index where the controller has no index action, fixed to #new
  • Specs used describe to prescribe contextual scenarios, updated to context
  • Specs were written context-first, rather than action-first

Easier to review with whitespace changes hidden: https://github.com/18F/identity-idp/pull/11355/files?w=1

Example before/after:

# Before:

describe 'when not signed in' do
  describe '#index' do
    it '...' do
      # ...
    end
  end
end

describe 'when signed out' do
  describe '#index' do
    it '...' do
      # ...
    end
  end
end

# After

describe '#new' do
  context 'when not signed in' do
    it '...' do
      # ...
    end
  end

  context 'when signed out' do
    it '...' do
      # ...
    end
  end
end

📜 Testing Plan

rspec spec/controllers/users/piv_cac_authentication_setup_controller_spec.rb

changelog: Internal, Automated Testing, Restructure PIV/CAC setup spec for consistency
@aduth aduth requested a review from a team October 16, 2024 20:15
Copy link
Contributor

@kevinsmaster5 kevinsmaster5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@aduth aduth merged commit b256afa into main Oct 17, 2024
@aduth aduth deleted the aduth-restructure-piv-setup-spec branch October 17, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants