Rspec doesn't see my model Class. uninitialized constant error

后端 未结 7 1890
予麋鹿
予麋鹿 2021-01-30 19:09

I\'m writing tests on Rspec for my models in Ruby on Rails application. And I receive this error while starting \'rspec spec\'

command:
/spec/models/client_spec         


        
相关标签:
7条回答
  • 2021-01-30 20:12

    In rails 4.x (rspec-rails 3.1.0) use

    require "rails_helper"  # this
    

    not

    require "spec_helper"   # not this
    

    in your spec files

    0 讨论(0)
提交回复
热议问题