Skip to content

Commit

Permalink
fix: Add default Rails tables to acceptance spec
Browse files Browse the repository at this point in the history
This commit fixes the problem of not finding the tables
when running the specs in eager load mode, this was introduced
by Rails 7.1.

Load the model schema when running test in eager load
context rails/rails#49470
  • Loading branch information
matsales28 committed Nov 10, 2023
1 parent 75612f6 commit aae4ed2
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion spec/acceptance/rails_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@
before do
create_rails_application

write_file 'db/migrate/1_create_users.rb', <<-FILE
write_file 'db/migrate/1_create_defaults.rb', <<-FILE
class CreateDefaults < #{migration_class_name}
def self.up
create_table :action_text_rich_texts
create_table :active_storage_variant_records
create_table :active_storage_blobs
create_table :active_storage_attachments
create_table :action_mailbox_inbound_emails do |t|
t.integer :status
end
end
end
FILE

write_file 'db/migrate/2_create_users.rb', <<-FILE
class CreateUsers < #{migration_class_name}
def self.up
create_table :users do |t|
Expand Down

0 comments on commit aae4ed2

Please sign in to comment.