Skip to content

Provide collision-free framework test fabricators - #189

Merged
dblock merged 1 commit into
slack-ruby:masterfrom
dblock:fix/fabricator-collision
Oct 25, 2026
Merged

dblock merged 1 commit into
slack-ruby:masterfrom
dblock:fix/fabricator-collision

Conversation

@dblock

@dblock dblock commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #19. Reproduced Fabrication::DuplicateFabricatorError by defining an application :team and then requiring the existing RSpec helper.

Add slack-ruby-bot-server/rspec/fabricators, which registers only the prefixed :slack_ruby_bot_server_team for the existing top-level Team model. Applications can explicitly define/load their own :team before or after this entry point, including deriving one from the prefixed defaults.

Preserve the legacy slack-ruby-bot-server/rspec entry point and the direct legacy fabricator path. They provide the existing :team name when it is free, but no longer overwrite or collide with an application definition already registered. Applications defining :team later should use the new prefixed-only entry point instead; document that loading both still opts into the legacy alias. Keep existing unique token/team ID sequences and Faker names. No runtime dependencies added.

Validation

Focused lint passes. API, model, service, and test-helper specs: 89 examples, 0 failures with both Mongoid 9.1 and Active Record 8.1 on Ruby 4/Grape 4. Existing pending examples remain (two Mongoid, one Active Record).

Six new cases cover persisted framework installations with unique credentials, legacy helper compatibility, preservation of an existing application factory, application inheritance, and both loading orders with the prefixed-only helper. Registration cases run in fresh Ruby subprocesses to verify real require behavior without mutating the parent Fabrication registry.

Authored by Copilot (AI), on behalf of @dblock.

@dblock
dblock force-pushed the fix/fabricator-collision branch 3 times, most recently from 7da8f16 to a14c748 Compare October 25, 2026 20:19
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

@dblock
dblock force-pushed the fix/fabricator-collision branch from a14c748 to 3121d3e Compare October 25, 2026 20:22
@dblock
dblock merged commit 71cdbcf into slack-ruby:master Oct 25, 2026
14 checks passed
@dblock
dblock deleted the fix/fabricator-collision branch October 25, 2026 20:26
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.

RSpec fabricator conflict

1 participant