rubyforgood / rubyforgood/casa

DRY Test Code

Open
#6,874 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🗺️ Epic Help Wanted no-issue-activity no-pr-activity
Dominant language
Ruby
Stars
381
Forks
542
Avg merge
3d 15h
Merged PRs (30d)
47

Description

Description

There's a lot of duplicate code within the test files. For each file, find the duplicate code and group it under a shared example or a private function.

A lot of the code follows the pattern: admin can do action, supervisor can usually do the same action, volunteer might be able to do the action as well. Since the code describing the action isn't DRY, the admin and supervisor tests might become divergent if the code in their blocks aren't duplicated.

How to access the QA site

Login Details:
Link to QA site

Login Emails:

  • volunteer1@example.com view site as a volunteer
  • supervisor1@example.com view site as a supervisor
  • casa_admin1@example.com view site as an admin
  • all_casa_admin1@example.com view site as an all casa admin
    • go to /all_casa_admins/sign_in

password for all users: 12345678

Questions? Join Slack!

We highly recommend that you join us in slack #casa channel to ask questions quickly. And discord for office hours (currently Tuesday 5-7pm Pacific), stakeholder news, and upcoming new issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by surveying the repository's test files and identify repeated action and role-specific test blocks, especially the admin, supervisor, and volunteer patterns described in the issue. Refactor duplicate sections into shared examples or private functions, then run the relevant test files to confirm the role behavior remains consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.