Skip to content

Commit

Permalink
Fix: uninitialized constant User in
Browse files Browse the repository at this point in the history
In the test setting Test (MONGOID, 3.1, mongoid_73.gemfile)

got this error:
SimpleCov failed with exit 1/home/runner/work/pluck_all/pluck_all/test/mongoid/support/seeds.rb:2:in `<top (required)>': uninitialized constant User (NameError)
  • Loading branch information
khiav reoy committed Jul 30, 2023
1 parent a93ff60 commit 95c4c50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/mongoid/support/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# frozen_string_literal: true

require 'rails_compatibility/setup_autoload_paths'
RailsCompatibility.setup_autoload_paths [File.expand_path('../models/', __FILE__)]

User.delete_all
User.create(name: 'Pearl Shi', age: 18)
User.create(name: 'Rumble Huang', age: 20)
Expand Down

0 comments on commit 95c4c50

Please sign in to comment.