Skip to content

Conversation

@patch0
Copy link
Contributor

@patch0 patch0 commented Jul 2, 2024

This PR adds a login page to use in testing to avoid having to render the rpf-global-nav in tests that don't need JS.

What's changed

  • Adds a page at /rpi_auth/test which shows a login and sign-up button that can be used in test scenarios
  • Adds a log_in(user:) and stub_auth_for(user:) methods that we've replicated in a lot of places.
  • Adds capybara to the development deps, and updated the gemfiles
  • Sets the rubygems version during CI because one of the Gems doesn't build with the older version of Rubygems that ships with Ruby 2.7

@github-actions
Copy link

github-actions bot commented Jul 2, 2024

Test coverage: 100%

@patch0 patch0 marked this pull request as ready for review July 2, 2024 20:06
@patch0 patch0 requested review from ChristinaVoss and grega July 2, 2024 20:06
@patch0 patch0 self-assigned this Jul 2, 2024
@patch0 patch0 changed the title Add test route thing Add test route for testing to avoid the shadow root/having to render the global nav Jul 2, 2024
@patch0 patch0 changed the title Add test route for testing to avoid the shadow root/having to render the global nav Add test route to avoid the shadow root/having to render the global nav Jul 3, 2024
grega
grega previously approved these changes Jul 3, 2024
Copy link
Member

@grega grega left a comment

Choose a reason for hiding this comment

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

Nice 👍

Airing one mostly unrelated thought; we can drop Ruby 2.7 support here (all apps using rpi-auth are >=3)

@patch0
Copy link
Contributor Author

patch0 commented Jul 4, 2024

Nice 👍

Airing one mostly unrelated thought; we can drop Ruby 2.7 support here (all apps using rpi-auth are >=3)

Yes, yes we can! I was slightly struggling with it tbh, but I thought it would be better done in a separate PR.

@patch0 patch0 enabled auto-merge (squash) July 4, 2024 08:08
@patch0 patch0 merged commit 7e48193 into main Jul 4, 2024
@patch0 patch0 deleted the add-login-page-for-testing branch July 4, 2024 08:32
@patch0 patch0 mentioned this pull request Jul 4, 2024
patch0 added a commit that referenced this pull request Jul 4, 2024
## Added

- Test controller/view to allow apps to log in without having to
interact with the RPF Global Nav component. (#70)
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.

3 participants