5
두 가지 질문이 있습니다액티브 레코드 추상 클래스 모의 및 레일에 무제한 객체를 스터핑하는 방법 : test :: unit/mocha?
1. 레일 테스트 케이스에서 무 처리 대상을 어떻게 스텁합니까?
2.Mock
- 내가 테스트 데이터베이스 X_test와 애플리케이션 X가 액티브 레코드 추상 클래스는, 지금은 존재하고 액티브 레코드 객체를 구현하는하지 않는 스텁에 데이터베이스 y_test 필요 추상 클래스
예를
Y::table.find_by_email("[email protected]").selected_lan["iden"]
module Y
class table <Base
belongs_to:selected_lan, :class =>lan
def self.find_by_email(iden)
find_by_email(license_iden)
end
end
end
module Y
class Base <ActiveRecord::Base
self.abstract_class = true
end
end