Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Refactor: Setting up FactoryBot and Contexts Module #331

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

PeterNotFound114
Copy link
Contributor

Overview

This PR proposes a new testing framework for Binder using the Factory Pattern provided by FactoryBot to create test instances, and the module system to organize test objects into module Contexts. This is consistent with patterns used throughout the course Application Design and Development (67-272).

Deliverables

  • Automated factory generation with scripts that parses db/schema.rb to get all columns and associations from DB schema (in case migration changes / new migrations are added)
  • Factory files generated via scripts
  • Set files and contexts.rb file under test/ outlining general structure of test object creation

Next Steps

  • Rename all non-FK columns that ends with "_id"
  • Migrate fixture objects to objects created using FactoryBot
  • Explore possibilities of automated ERD generation using similar scripts as the one parsing the schema file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant