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

Fixed : “NameError: constant Object::User not defined” error message when you run the single spec file #58

Merged
merged 1 commit into from
May 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refer User before calling remove_const to avoid NameError
shozawa committed Apr 29, 2017
commit a7264651a86e4124465461e9851169d7405bd45c
2 changes: 1 addition & 1 deletion lib/sorcery/test_helpers/internal.rb
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ def update_model(&block)
# reload user class between specs
# so it will be possible to test the different submodules in isolation
def reload_user_class
Object.send(:remove_const, 'User')
User && Object.send(:remove_const, 'User')
load 'user.rb'
if User.respond_to?(:reset_column_information)
User.reset_column_information