Skip to content

Conversation

@PeterNotFound114
Copy link
Contributor

@PeterNotFound114 PeterNotFound114 commented Mar 10, 2025

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