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

后端 未结 7 2028
予麋鹿
予麋鹿 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

提交回复
热议问题