Story #2 Member Sign Up Captcha | User and Technical Documentation - cseseniordesign/reservations GitHub Wiki

End User Documentation

Dev Testing Instructions

  1. Make sure you are on the most recent version of the Development branch.
  2. Start your dev environment and navigate to the page http://localhost:9393/new_members/.
    • Ensure you are on localhost specifically as google reCaptcha requires specific domains to be registered.
  3. Select one of the sign up events to move forward to the sign up page.
  4. Ensure that the reCaptcha is rendered at the bottom of the form.
  5. Test the reCaptcha by both completing the verification and not completing the verification.
    • Ensure you still enter information for the member every time you test the reCaptcha.
    • reCaptcha data is stored in cache so not every attempt will require you to complete the puzzle associated.
  6. You can verify the reCaptcha attempts by going to https://www.google.com/recaptcha/about/ and logging into the v3 Admin Console.
    • The admin portal can only display the previous days attempts.
  7. Ensure no errors are thrown by the reCaptcha.

Production Testing Instructions

  1. Navigate to https://innovationstudio-manager.unl.edu/new_members/.
  2. Repeat steps 3 and up from above.

Technical Documentation

Gemfile

routes/new_members.rb

  • added recaptcha as a requirement
  • Configured Recaptcha with the site_key and the secret_key.
    • These are given to us by the admin portal settings from step 6 of the testing.
  • included methods as needed according to the read me of the above github
  • passed Recaptcha.recaptcha_tags to the new_member_signup erb
  • added an if statement that checks verify_recaptcha and redirects with a flash alert if the returned value is false
    • verify_recaptcha has been copied and pasted from Recaptcha::Adapters::ControllerMethods as an error of the method being private was being thrown.

routes/views/new_members_signup.erb

  • reformatted the sign up button into being contained in a form
  • added <%= recaptcha %> which runs the javascript necessary to render the reCaptcha from the value passed in to the erb (mentioned above)