2

The module that I am trying to include is located here: test/unit/helpers/test_helpers.rb

Looks like:

module TestHelpers
end

I am trying to include it in: test/unit/app/models/abc.rb

class Abc < ActiveSupport::TestCase
include TestHelpers
end

gives the following error:

Error executing test/unit/app/models/abc.rb uninitialized constant Abc::TestHelpers

Any ideas why this might be happening?

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Vivek
  • 153
  • 1
  • 2
  • 9

1 Answers1

7

To include a module into your class, you need to require that file.

require 'test_helpers'

Add this line at the top of your model class.

Kundan Pandit
  • 412
  • 6
  • 17