1
는
내 사용자 클래스를 테스트 할 Shoulda
를 사용하는 것을 시도하고있다 :NoMethodError : 정의되지 않은 메서드`failure_message` - 다음과 같이 했어야
user_test.rb
require 'test_helper'
include Devise::TestHelpers
class UserTest < Test::Unit::TestCase
should have_many(:holidays)
should have_many(:hopsital_bookings)
should have_and_belong_to_many(:roles)
should belong_to(:hospital)
end
User.rb
belongs_to :hospital
belongs_to :department
has_many :holidays
has_many :hospital_bookings
has_and_belongs_to_many :roles
rake test
을 실행하면 다음 출력이 표시됩니다. Imgur.
내가 여기에 누락 된 이유는 무엇이며 왜 이것이 작동하지 않는 이유입니까?
'test_helper.rb'에 무엇이 있습니까? –